import cv2 from body import PoseDetector from hand import HandDetector if __name__ == '__main__': cap = cv2.VideoCapture() cap.open(0) detector1 = PoseDetector() detector2 = HandDetector() while cap.isOpened(): success, frame = cap.read() frame = cv2.flip(frame,1) if not success: raise ValueError("Error") frame = detector2.process_frame(frame) frame = detector1.find_pose(frame, draw=True) cv2.imshow("hand", frame) if cv2.waitKey(1) in [ord('q'), 27]: break cap.release() cv2.destroyAllWindows()