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

LabelMe Crashes with SegmentAnything Model (Speed Version) for Automatic Annotation #1387

Closed
dnyanshwalwadkar opened this issue Jan 3, 2024 · 0 comments · Fixed by #1391
Closed
Labels
bug issue

Comments

@dnyanshwalwadkar
Copy link

Provide environment information

Python 3.10.0
Labelme 5.3.1

What OS are you using?

macOS Sanoma 14.0

Describe the Bug

When attempting to use the SegmentAnything model (speed version) for automatic annotation in LabelMe, the software crashes and the program closes abruptly.
However, using the balanced and accuracy models of SegmentAnything does not cause any issues.

Error :
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/labelme/widgets/canvas.py", line 773, in paintEvent
points = self._ai_model.predict_polygon_from_points(
File "/usr/local/lib/python3.10/site-packages/labelme/ai/models/segment_anything.py", line 64, in predict_polygon_from_points
polygon = _compute_polygon_from_points(
File "/usr/local/lib/python3.10/site-packages/labelme/ai/models/segment_anything.py", line 172, in _compute_polygon_from_points
contour = max(contours, key=_get_contour_length)
ValueError: max() arg is an empty sequence
[1] 30792 abort labelme

Expected Behavior

I expected LabelMe to perform automatic annotation using the SegmentAnything model (speed version) without crashing, similar to how it behaves with the balanced and accuracy models.

To Reproduce

  1. Open LabelMe. ( 5.3.1)
  2. Load any image and use Segment Anything ( Speed ) model to get annotations.
  3. Click on image to get segmentation annotation.
  4. Wait for sometime to model processing.
  5. As this completed, immediately observe that the software crashes, without showing annotations or allowing us to edit or modify.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant