Skip to content
Snippets Groups Projects
Commit a5194a79 authored by Rustia, Dan's avatar Rustia, Dan
Browse files

fix ops

parent e1297e72
Branches
No related tags found
No related merge requests found
......@@ -534,21 +534,23 @@ def embed_output(img_output, a, cfg, custom_label=""):
if cfg.cfg["display"]["show_contour"] and cfg.operation != "object_detection":
try:
polygon_lengths = [len(px) for px in pp]
if cfg.cfg["display"]["contour_style"] == "simple":
polygon_lengths = [len(px) for px in pp]
if cfg.cfg["display"]["contour_style"] == "simple":
try:
max_polygon = pp[polygon_lengths.index(max(polygon_lengths))]
px = [max_polygon.astype(np.int64).reshape(-1, 2)]
cv2.drawContours(img_output, px, 0, color, cfg.cfg["display"]["thickness"]*2)
except:
pass
if cfg.cfg["display"]["contour_style"] == "complex":
for polygon in pp:
px = np.asarray(polygon).astype(np.int64).reshape(-1, 2)
cv2.drawContours(img_output, [px], -1, color, cfg.cfg["display"]["thickness"])
if cfg.cfg["display"]["contour_style"] == "complex":
for polygon in pp:
px = np.asarray(polygon).astype(np.int64).reshape(-1, 2)
cv2.drawContours(img_output, [px], -1, color, cfg.cfg["display"]["thickness"])
except Exception as e:
print(e)
if cfg.cfg["display"]["show_contour_alpha"]:
colored_mask = np.expand_dims(m, 0).repeat(3, axis=0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment