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

Upload of annotations with overwrite=true does not work #214

Open
rutgerfick opened this issue Dec 28, 2023 · 1 comment
Open

Upload of annotations with overwrite=true does not work #214

rutgerfick opened this issue Dec 28, 2023 · 1 comment

Comments

@rutgerfick
Copy link

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?

@npelzmann
Copy link
Contributor

npelzmann commented Jan 4, 2024

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

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