From e7b63126d24f1558fbf77d2758ec4d9474e587c6 Mon Sep 17 00:00:00 2001 From: slashtechno <77907286+slashtechno@users.noreply.github.com> Date: Fri, 22 Dec 2023 16:44:21 -0600 Subject: [PATCH] Fixed (?) prior error causing null `frame_to_show` --- wyzely_detect/__main__.py | 2 -- wyzely_detect/utils/utils.py | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/wyzely_detect/__main__.py b/wyzely_detect/__main__.py index d17be86..7d8e16c 100644 --- a/wyzely_detect/__main__.py +++ b/wyzely_detect/__main__.py @@ -88,8 +88,6 @@ def main(): # Display the resulting frame # TODO: When multi-camera support is added, this needs to be changed to allow all feeds if not args.no_display: - # When a face isn't recognized: "cv2.error: OpenCV(4.8.1) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:971: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'" - # Seems to be because frame_to_show is null cv2.imshow("Video", frame_to_show) # Hit 'q' on the keyboard to quit! diff --git a/wyzely_detect/utils/utils.py b/wyzely_detect/utils/utils.py index bc6a3b0..b5fcd6d 100644 --- a/wyzely_detect/utils/utils.py +++ b/wyzely_detect/utils/utils.py @@ -150,16 +150,16 @@ def process_footage( ) - # To debug plotting, use r.plot() to cross reference the bounding boxes drawn by the plot_label() and r.plot() - frame_to_show = plot_label( - boxes=plot_boxes, - full_frame=frame, - # full_frame=r.plot(), - run_scale=run_scale, - view_scale=view_scale, - ) - # Unsure if this should also return the objects_and_peoples dict - return frame_to_show + # To debug plotting, use r.plot() to cross reference the bounding boxes drawn by the plot_label() and r.plot() + frame_to_show = plot_label( + boxes=plot_boxes, + full_frame=frame, + # full_frame=r.plot(), + run_scale=run_scale, + view_scale=view_scale, + ) + # Unsure if this should also return the objects_and_peoples dict + return frame_to_show def plot_label(