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

render_bounding_box fail on polyline with no vertex #641

Closed
wickeat opened this issue Dec 24, 2024 · 1 comment · Fixed by #642
Closed

render_bounding_box fail on polyline with no vertex #641

wickeat opened this issue Dec 24, 2024 · 1 comment · Fixed by #642

Comments

@wickeat
Copy link

wickeat commented Dec 24, 2024

The image util function render_bounding_box throws a ValueError: not enough values to unpack (expected 2, got 0) exception if the polyline to render has no vertex.

eta/eta/core/image.py

Lines 1116 to 1125 in f45e571

def render_bounding_box(polyline):
"""Renders a tight BoundingBox around the given Polyline.
Args:
polyline: a Polyline
Returns:
a BoundingBox
"""
xx, yy = zip(*list(itertools.chain(*polyline.points)))

This happens since a Polyline can contain no vertex.

eta/eta/core/polylines.py

Lines 110 to 113 in f45e571

@property
def has_vertices(self):
"""Whether the polyline has at least one vertex."""
return any(bool(shape) for shape in self.points)

@brimoor
Copy link
Contributor

brimoor commented Dec 29, 2024

Thanks for catching! This will be fixed by #642 and available in fiftyone>1.2.

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 a pull request may close this issue.

2 participants