From 4b921c898b96db1c0a6402d819ffb688e87319aa Mon Sep 17 00:00:00 2001 From: hzwer <598460606@163.com> Date: Sun, 22 Nov 2020 10:35:35 +0800 Subject: [PATCH] Fix clear --- inference_video.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/inference_video.py b/inference_video.py index 4837eb3..edccf69 100644 --- a/inference_video.py +++ b/inference_video.py @@ -74,6 +74,7 @@ skip_frame = 1 if args.montage: frame = frame[:, left: left + w] buffer = Queue() +_thread.start_new_thread(clear_buffer, (args, buffer)) while success: lastframe = frame success, frame = videoCapture.read() @@ -119,14 +120,10 @@ while success: if args.exp == 4: buffer.put(mid2[:h, :w]) pbar.update(1) - if buffer.qsize() > 100: - _thread.start_new_thread(clear_buffer, (args, buffer)) - buffer.clear() if args.montage: buffer.put(np.concatenate((lastframe, lastframe), 1)) else: buffer.put(lastframe) -_thread.start_new_thread(clear_buffer, (args, buffer)) pbar.close() if not vid_out is None: vid_out.release()