Skip to content

Clarity between hosted_image and is_hosted in Project.upload #233

Description

@LinasKo

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'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions