From 75af46d2739245bb46de9fd30e541e2b6de3b077 Mon Sep 17 00:00:00 2001 From: kinaryml Date: Tue, 25 Oct 2022 23:13:12 -0700 Subject: [PATCH] Revised API to align with recent changes --- .../python/components/containers/classification.py | 10 ++-------- .../python/test/vision/gesture_recognizer_test.py | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/mediapipe/tasks/python/components/containers/classification.py b/mediapipe/tasks/python/components/containers/classification.py index 465e2dd28..a9225e804 100644 --- a/mediapipe/tasks/python/components/containers/classification.py +++ b/mediapipe/tasks/python/components/containers/classification.py @@ -85,8 +85,6 @@ class ClassificationList: """ classifications: List[Classification] - tensor_index: Optional[int] = None - tensor_name: Optional[str] = None @doc_controls.do_not_generate_docs def to_pb2(self) -> _ClassificationListProto: @@ -95,9 +93,7 @@ class ClassificationList: classification=[ classification.to_pb2() for classification in self.classifications - ], - tensor_index=self.tensor_index, - tensor_name=self.tensor_name) + ]) @classmethod @doc_controls.do_not_generate_docs @@ -110,9 +106,7 @@ class ClassificationList: classifications=[ Classification.create_from_pb2(classification) for classification in pb2_obj.classification - ], - tensor_index=pb2_obj.tensor_index, - tensor_name=pb2_obj.tensor_name) + ]) def __eq__(self, other: Any) -> bool: """Checks if this object is equal to the given object. diff --git a/mediapipe/tasks/python/test/vision/gesture_recognizer_test.py b/mediapipe/tasks/python/test/vision/gesture_recognizer_test.py index a8316c528..3bf994a1d 100644 --- a/mediapipe/tasks/python/test/vision/gesture_recognizer_test.py +++ b/mediapipe/tasks/python/test/vision/gesture_recognizer_test.py @@ -80,7 +80,7 @@ def _get_expected_gesture_recognition_result( classifications=[ _Classification(label=gesture_label, index=gesture_index, display_name='') - ], tensor_index=0, tensor_name='') + ]) return _GestureRecognitionResult( gestures=[gesture], handedness=[landmarks_detection_result.classifications],