diff --git a/tests/show_yolo_seg.py b/tests/show_yolo_seg.py index 9f7eb53..e53b118 100644 --- a/tests/show_yolo_seg.py +++ b/tests/show_yolo_seg.py @@ -196,7 +196,9 @@ def main(): bbox = np.array(bbox) * np.array([img.shape[1], img.shape[0], img.shape[1], img.shape[0]]) yc, xc, h, w = bbox print("bbox", bbox) - polyline = np.array(coords[4:]).reshape(-1, 2) * np.array([img.shape[1], img.shape[0]]) + + # polyline = np.array(coords[4:]).reshape(-1, 2) * np.array([img.shape[1], img.shape[0]]) + polyline = np.array(coords).reshape(-1, 2) * np.array([img.shape[1], img.shape[0]]) print("pl", coords[4:]) print("pl", polyline) @@ -207,12 +209,13 @@ def main(): plt.figure(figsize=(10, 10 * out.shape[0] / out.shape[1])) plt.imshow(out_rgb) plt.plot(polyline[:, 0], polyline[:, 1], "y", linewidth=2) - plt.plot( - [yc - h / 2, yc - h / 2, yc + h / 2, yc + h / 2, yc - h / 2], - [xc - w / 2, xc + w / 2, xc + w / 2, xc - w / 2, xc - w / 2], - "r", - linewidth=2, - ) + if 0: + plt.plot( + [yc - h / 2, yc - h / 2, yc + h / 2, yc + h / 2, yc - h / 2], + [xc - w / 2, xc + w / 2, xc + w / 2, xc - w / 2, xc - w / 2], + "r", + linewidth=2, + ) # plt.axis("off") plt.title(f"{img_path.name} ({lbl_path.name})")