From 886e59971374bac6cc2387a0b6cf0c8bf0447eeb Mon Sep 17 00:00:00 2001 From: Sandeep Sabbella Date: Tue, 23 Jul 2024 20:52:50 +0200 Subject: [PATCH] Update for returning gesture index in gesture_recognizer.py The gesture recognizer is returning a default value of -1. changed the _GESTURE_DEFAULT_INDEX to gesture.index to return the gesture class index (id:int). Now the respective class index is returned when the category is predicted by the model. --- mediapipe/tasks/python/vision/gesture_recognizer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediapipe/tasks/python/vision/gesture_recognizer.py b/mediapipe/tasks/python/vision/gesture_recognizer.py index 044dd17bd7..8938c6ffb1 100644 --- a/mediapipe/tasks/python/vision/gesture_recognizer.py +++ b/mediapipe/tasks/python/vision/gesture_recognizer.py @@ -106,7 +106,7 @@ def _build_recognition_result( for gesture in gesture_classifications.classification: gesture_categories.append( category_module.Category( - index=_GESTURE_DEFAULT_INDEX, + index=gesture.index, score=gesture.score, display_name=gesture.display_name, category_name=gesture.label,