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

Clarity between hosted_image and is_hosted in Project.upload #233

Open
LinasKo opened this issue Feb 27, 2024 · 0 comments
Open

Clarity between hosted_image and is_hosted in Project.upload #233

LinasKo opened this issue Feb 27, 2024 · 0 comments

Comments

@LinasKo
Copy link
Contributor

LinasKo commented Feb 27, 2024

I find it confusing that in Project.upload there's both a hosted_image: boolargument set by the user, and an internal is_hosted, that determines which errors may be thrown.

By setting hosted_image it's possible to bypass checks and send the image to Roboflow, which promptly returns a 500 code.

Still, maybe there's a reason behind it?

Test code:

import roboflow

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

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

project.upload(img_path, hosted_image=True)

This raises:

File  ... /roboflow/adapters/rfapi.py:90, in upload_image(api_key, project_url, image_path, hosted_image, split, batch_name, tag_names, sequence_number, sequence_size, **kwargs)
UploadError: Bad response: 500: {'error': 'Unknown error'}
@LinasKo LinasKo changed the title Lacking docs for project.py - hosted_image, is_hosted Clarity between hosted_image and is_hosted in project.py Feb 27, 2024
@LinasKo LinasKo changed the title Clarity between hosted_image and is_hosted in project.py Clarity between hosted_image and is_hosted in Project.upload Feb 27, 2024
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

1 participant