roboflow / roboflow-python

The official Roboflow Python package. Manage your datasets, models, and deployments. Roboflow has everything you need to build a computer vision application.
https://docs.roboflow.com/python
Apache License 2.0
272 stars 71 forks source link

In Project#upload the argument batch_name has no effect #253

Closed AlainPilon closed 1 month ago

AlainPilon commented 3 months ago

The following code:

project.upload(image_path='https://imgs.michaels.com/MAM/assets/1/726D45CA1C364650A39CD1B336F03305/img/A3A0E13DF0934FFDA4D0A3B01E2E99DE/004957.jpg', hosted_image=True, batch_name='will not work', tag_names=['one', 'two'])

will not create a new batch under the Annotation section. It will just put the uploaded file under the "Uploaded from API" batch.

Also the file will not be tagged.

joaomarcoscrs commented 2 months ago

Seems like the _hosted_upload_url method is forgetting to consider both batch_name and tag_names when building the URL to upload the images. It should work properly for local hosted images though.

Don't know if this is intentional, but it doesn't seem to be.

https://github.com/roboflow/roboflow-python/blob/013512b0054d1c25e5e40af548d64193afec3f08/roboflow/adapters/rfapi.py#L160

I created this pull request, think that should solve it:

https://github.com/roboflow/roboflow-python/pull/268

iurisilvio commented 1 month ago

Fixed by #268! 🎉