Skip to content

Commit 6a87e01

Browse files
committed
Don't flip up down anymore, dropping V3 support
1 parent e538306 commit 6a87e01

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

labelbox/exporters/coco_exporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def _append_polygons_as_annotations(coco, image, category_id, polygons):
127127
for polygon in polygons:
128128
segmentation = []
129129
for x_val, y_val in polygon.exterior.coords:
130-
segmentation.extend([x_val, image['height'] - y_val])
130+
segmentation.extend([x_val, y_val])
131131

132132
annotation = {
133133
"id": len(coco['annotations']) + 1,

labelbox/exporters/voc_exporter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def _add_pascal_object_from_wkt(xml_writer, img_height, wkt_data, label):
124124
for point in polygons:
125125
xy_coords = []
126126
for x_val, y_val in point.exterior.coords:
127-
xy_coords.extend([x_val, img_height - y_val])
127+
xy_coords.extend([x_val, y_val])
128128
# remove last polygon if it is identical to first point
129129
if xy_coords[-2:] == xy_coords[:2]:
130130
xy_coords = xy_coords[:-2]
@@ -134,7 +134,7 @@ def _add_pascal_object_from_wkt(xml_writer, img_height, wkt_data, label):
134134

135135
def _add_pascal_object_from_xy(xml_writer, img_height, polygons, label):
136136
if not isinstance(polygons, list):
137-
# polygons is not [{'geometry': [xy]}] nor [[xy]]
137+
LOGGER.warning('polygons is not [{geometry: [xy]}] nor [[xy]], skipping')
138138
return xml_writer
139139
for polygon in polygons:
140140
if 'geometry' in polygon: # V3
@@ -146,6 +146,6 @@ def _add_pascal_object_from_xy(xml_writer, img_height, polygons, label):
146146

147147
xy_coords = []
148148
for point in polygon:
149-
xy_coords.extend([point['x'], img_height - point['y']])
149+
xy_coords.extend([point['x'], point['y']])
150150
xml_writer.add_object(name=label, xy_coords=xy_coords)
151151
return xml_writer

0 commit comments

Comments
 (0)