Skip to content

Commit 49a14a0

Browse files
authored
Added resizable cv2 window (#366)
1 parent e7a5a99 commit 49a14a0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

luxonis_ml/data/__main__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ def inspect(
397397
new_h, new_w = int(h * size_multiplier), int(w * size_multiplier)
398398
image = cv2.resize(image, (new_w, new_h))
399399

400+
cv2.namedWindow(source_name, cv2.WINDOW_NORMAL)
400401
if per_instance and matched_instance_keys:
401402
extra_keys = [
402403
k for k in labels if k not in matched_instance_keys
@@ -419,6 +420,11 @@ def inspect(
419420
classes,
420421
blend_all=blend_all,
421422
)
423+
cv2.resizeWindow(
424+
source_name,
425+
instance_image.shape[1],
426+
instance_image.shape[0],
427+
)
422428
cv2.imshow(source_name, instance_image)
423429
if cv2.waitKey() == ord("q"):
424430
break
@@ -431,6 +437,9 @@ def inspect(
431437
labeled_image = visualize(
432438
image, source_name, labels, classes, blend_all=blend_all
433439
)
440+
cv2.resizeWindow(
441+
source_name, labeled_image.shape[1], labeled_image.shape[0]
442+
)
434443
cv2.imshow(source_name, labeled_image)
435444

436445
prev_windows = current_windows

0 commit comments

Comments
 (0)