From ba72218df50c5299619424ffe6ca846b1a41faab Mon Sep 17 00:00:00 2001 From: Andrzej Preibisz Date: Mon, 30 Jan 2023 16:08:54 +0100 Subject: [PATCH] WIP --- process_video.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/process_video.py b/process_video.py index f28da94..081dfb6 100644 --- a/process_video.py +++ b/process_video.py @@ -1,6 +1,8 @@ import cv2 import tensorflow as tf import numpy as np +from crop_hands_skeleton import crop_hands +from cvzone.HandTrackingModule import HandDetector class_names = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'del', 'nothing', 'space'] @@ -29,9 +31,10 @@ def segment_video(video, fps=5): return result, num def save_frames(frames, dir): + detector = HandDetector(maxHands=1, mode=True, detectionCon=0.7, minTrackCon=0.8) for i, frame in enumerate(frames): print(i) - cv2.imwrite(f"{dir}/frame{i}.jpg", frame) + cv2.imwrite(f"{dir}/frame{i}.jpg", crop_hands(frame, detector)) def classify(img, model):