roboflow-python
roboflow-python copied to clipboard
Roboflow API fails silently when invalid annotations file is uploaded.
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.
Hey, I have created a PR to handle this, lmk if it matches your idea