Skip to content

Commit 2a1ff0e

Browse files
authored
Merge pull request #6 from Labelbox/filter-non-polylgons
Handle lines
2 parents b782b9e + 371aab7 commit 2a1ff0e

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ instance/
6565

6666
# Sphinx documentation
6767
docs/_build/
68+
docs/.doctrees
6869

6970
# PyBuilder
7071
target/

labelbox/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"The Labelbox python package."
22

3-
__version__ = '0.0.5'
3+
__version__ = '0.0.6'

labelbox/exporters/coco_exporter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ def _get_polygons(label_format, label_data):
162162
# skip non xy lists
163163
continue
164164

165-
polygons.append(Polygon(map(lambda p: (p['x'], p['y']), xy_list)))
165+
if len(xy_list) > 2: # need at least 3 points to make a polygon
166+
polygons.append(Polygon(map(lambda p: (p['x'], p['y']), xy_list)))
166167
else:
167168
exc = UnknownFormatError(label_format=label_format)
168169
logging.exception(exc.message)

0 commit comments

Comments
 (0)