Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roboflow API fails silently when invalid annotations file is uploaded. #235

Open
LinasKo opened this issue Feb 27, 2024 · 1 comment
Open

Comments

@LinasKo
Copy link
Collaborator

LinasKo commented Feb 27, 2024

Likely something to be passed to the back-end team.

When debugging the annotations format, it would be useful to know when an incorrect file was uploaded. Even if it did not tell what exactly was wrong. As it stands, it now fails silently, as if annotation were applied.

Test

import json
import roboflow

rf = roboflow.Roboflow(api_key="API_KEY")
img_path = "<path_to_img>"

workspace_id = "<ws ID>"
project_id = "<proj ID>"
workspace = rf.workspace(workspace_id)
project = workspace.project(project_id)

annotation = {
    "it is": [
        {
            "very frustrating": 0,
            "when you": "send",
            "an annotation": {
                "file and": 0.5,
                
                "function": 0.5,
                "call": 0.5,
                "completes": 0.5,
                "successfully,": 0.5,

            },
            "but": "there's",
            "no": "annotations",
            "on": "the website",
            "nor": "any",
            "errors": "raised",
        }
    ]
}
with open("annotation.json", "w") as f:
    json.dump(annotation, f)

image = project.upload(img_path, annotation_path="annotation.json")

This passes.

@caiquejjx
Copy link
Contributor

caiquejjx commented Jun 23, 2024

Hey, I have created a PR to handle this, lmk if it matches your idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants