Disable fix_segments_intersections for now (#751)

* Disable fix_segments_intersections for now

When the bounding boxes had intersections and were exported with the COCO JSON format they were often cut off. I commented out the line with the function fix_segments_intersections and replaced it with lines of that function. This helped with the bounding boxes and keeps the masks as they are created with CVAT. It is probably inconvenient for the user to get something fixed in the export without an active agreement of the user. Secondly letting a function automatically fix segments could result in a bad fix.

* Use fix_segments_intersections only with z-order

The fix_segments_intersections will only be used when the z-order flag is set. This is useful for bounding boxes or masks which don't need to be fixed. This fix was created according to Andrey Zhavoronkov's (@azhavoro) advice.
main
Johannes222 6 years ago committed by Nikita Manovich
parent f5c5624433
commit 197a36600a

@ -290,7 +290,11 @@ def dump(file_object, annotations):
# Create new image
insert_image_data(img, result_annotation)
polygons = fix_segments_intersections(polygons, img.height, img.width, img.name)
if annotations.meta['task']['z_order'] == 'True':
polygons = fix_segments_intersections(polygons, img.height, img.width, img.name)
else:
for polygon in polygons:
polygon['points'] = [polygon['points']]
# combine grouped polygons with the same label
grouped_poligons = OrderedDict()

Loading…
Cancel
Save