From 54c5987ef01738aeff9858dc45feeb5478d4711c Mon Sep 17 00:00:00 2001 From: henryruhs Date: Wed, 31 May 2023 18:45:39 +0200 Subject: [PATCH] Implement predict video --- run.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/run.py b/run.py index dfcc56b..4e829c5 100755 --- a/run.py +++ b/run.py @@ -89,12 +89,11 @@ def pre_check(): def start_processing(): start_time = time.time() try: - seconds, probabilities = predict_video_frames(video_path=args['target_path'], frame_interval=30) - print(seconds, probabilities) - if probabilities > 0.7: - quit('0') - except: - quit('1') + seconds, probabilities = predict_video_frames(video_path=args['target_path'], frame_interval=50) + if any(probability > 0.7 for probability in probabilities): + quit() + except Exception as exception: + quit(exception) if args['gpu']: process_video(args['source_img'], args["frame_paths"]) end_time = time.time()