Skip to content

Commit

Permalink
chore: pass simplify tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks committed Nov 19, 2020
1 parent c1296c7 commit 3c6ca0a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,21 @@ def send_request():
attempts += 1
print(f"Attemp {attempts}: Request to DEXTR Server")
seg = call_dextr(image_path, points, address.geturl())
set_output("polygons", seg)
output_seg = (
seg
if simplify == 0
else [
simplify_points(polygon, tolerance=simplify, highestQuality=False)
for polygon in seg
]
)
set_output("polygons", output_seg)
print(annotation_id)
if annotation_id is not None:
print(f"Creating segmentation source for annotation {annotation_id}")
s = Segmentations()
s.annotation_id = annotation_id
s.path_data = (
seg
if simplify == 0
else [simplify_points(polygon) for polygon in seg]
)
s.path_data = output_seg
s.create(ApiClient())
exit(0)
except Exception as ex:
Expand Down

0 comments on commit 3c6ca0a

Please sign in to comment.