Skip to content

Conversation

@alessandro-oe
Copy link

Currently SAM 2 doesn't work when the label studio interface image is defined with valueList

it gets this error:

  File "/app/model.py", line 86, in _sam_predict
    self.set_image(img_url, task.get('id'))
  File "/app/model.py", line 80, in set_image
    image_path = get_local_path(image_url, task_id=task_id)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/lib/python3.11/site-packages/label_studio_sdk/_extensions/label_studio_tools/core/utils/io.py", line 114, in get_local_path
    if url.startswith("upload") or url.startswith("/upload"):
       ^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'startswith'

This PR considers this case and adds a fix

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

Successfully merging this pull request may close these issues.

1 participant