From ab8a840dc84ed0b3db4465b2b463b44463d70af3 Mon Sep 17 00:00:00 2001 From: mattm001 Date: Sun, 25 Feb 2024 04:45:30 +0000 Subject: [PATCH] Got rid of unnecessary code --- HandAI/main.py | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/HandAI/main.py b/HandAI/main.py index 7e32b86..f4f0d3f 100644 --- a/HandAI/main.py +++ b/HandAI/main.py @@ -2,33 +2,8 @@ import cv2 topGesturesArray = [0,0,0,0] #up, down, palm, none -def mainLoop(numpy_image): -# BaseOptions = mp.tasks.BaseOptions -# GestureRecognizer = mp.tasks.vision.GestureRecognizer -# GestureRecognizerOptions = mp.tasks.vision.GestureRecognizerOptions -# VisionRunningMode = mp.tasks.vision.RunningMode - -# # Create a gesture recognizer instance with the image mode: -# options = GestureRecognizerOptions( -# base_options=BaseOptions(model_asset_path='/path/to/model.task'), -# running_mode=VisionRunningMode.IMAGE) -# with GestureRecognizer.create_from_options(options) as recognizer: -# # The detector is initialized. Use it here. -# # ... - - - -# # # Load the input image from an image file. -# # mp_image = mp.Image.create_from_file('/path/to/image') - -# # Load the input image from a numpy array. -# mp_image = mp.Image(image_format=mp.ImageFormat.SRGB, data=numpy_image) -# # Perform gesture recognition on the provided single image. -# # The gesture recognizer must be created with the image mode. -# gesture_recognition_result = recognizer.recognize(mp_image) -# return gesture_recognition_result - - # STEP 1: Import the necessary modules. +def mainLoop(numpy_image): + # STEP 1: Import the necessary modules. import mediapipe as mp from mediapipe.tasks import python from mediapipe.tasks.python import vision