roboflow-python
roboflow-python copied to clipboard
Upload of annotations with overwrite=true does not work
Hello, I'm using your example:
out = project.single_upload(
image_path=im_path,
annotation_path=annot_path,
annotation_labelmap=class_path,
overwrite=True, num_retry_uploads=4
)
on an image that I have already uploaded with an annotation previously. However, the out variable has the value:
{'image': {'duplicate': True, 'id': '5L3NfNHRHfZr06q6ojvv'}, 'annotation': {'error': UploadError("save annotation for 5L3NfNHRHfZr06q6ojvv / bad response: 400: {'message': 'Image was already annotated.', 'type': 'InvalidImageException', 'hint': 'This image was already annotated; to overwrite the annotation, pass overwrite=true as a query parameter.'}")}}
It seems the overwrite variable does nothing in this function, or is there another place I need to set this overwrite=true?
Hey @rutgerfick,
I had the same issue and did a bit of digging in the source code for the Project
class. If you pass overwrite as a kwarg, it's never passed to the REST API request for the annotations, only to the one for the image. I fixed it and will create a pull request. If you urgently need this, let me know, and I will tell you how I did a quick-fix.
edit: pull request #216