You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
per_frame_function callbacks and others from the family could return a boolean value to indicate to ImageAI that detection should be aborted. My scenario is the following: I'm using detectObjectsFromVideo function to detect objects in webcam. I'm passing per_frame_function to process detected objects and show info to the user. If the user decides to close the window, the detectObjectsFromVideo function should terminate gracefully, but the program should be allowed to continue to do other tasks.
So I propose to have something like this:
defforFrame(frame_number, output_array, output_count, returned_frame):
process_frame()
display_frame()
# ...ifwindow_is_closed:
returnTrue# <--- this means 'finish detection'
If the return statement will be omitted in the per_xxx_function, the return value will be None thus allowing detection to continue. That will provide backward compatibility.
The text was updated successfully, but these errors were encountered:
per_frame_function
callbacks and others from the family could return a boolean value to indicate to ImageAI that detection should be aborted. My scenario is the following: I'm usingdetectObjectsFromVideo
function to detect objects in webcam. I'm passingper_frame_function
to process detected objects and show info to the user. If the user decides to close the window, thedetectObjectsFromVideo
function should terminate gracefully, but the program should be allowed to continue to do other tasks.So I propose to have something like this:
If the return statement will be omitted in the
per_xxx_function
, the return value will be None thus allowing detection to continue. That will provide backward compatibility.The text was updated successfully, but these errors were encountered: