From a430939fe4b333ddb31a254f6a08b072f7dfff57 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Thu, 1 Dec 2022 07:42:55 -0800 Subject: [PATCH] Document RunningMode PiperOrigin-RevId: 492193299 --- .../vision/gesture_recognizer/gesture_recognizer.ts | 8 ++++++-- .../web/vision/hand_landmarker/hand_landmarker.ts | 8 ++++++-- .../web/vision/image_classifier/image_classifier.ts | 6 ++++-- .../tasks/web/vision/image_embedder/image_embedder.ts | 11 ++++------- .../web/vision/object_detector/object_detector.ts | 8 ++++++-- 5 files changed, 26 insertions(+), 15 deletions(-) diff --git a/mediapipe/tasks/web/vision/gesture_recognizer/gesture_recognizer.ts b/mediapipe/tasks/web/vision/gesture_recognizer/gesture_recognizer.ts index 7441911c..9ec63b07 100644 --- a/mediapipe/tasks/web/vision/gesture_recognizer/gesture_recognizer.ts +++ b/mediapipe/tasks/web/vision/gesture_recognizer/gesture_recognizer.ts @@ -225,7 +225,9 @@ export class GestureRecognizer extends /** * Performs gesture recognition on the provided single image and waits - * synchronously for the response. + * synchronously for the response. Only use this method when the + * GestureRecognizer is created with running mode `image`. + * * @param image A single image to process. * @return The detected gestures. */ @@ -235,7 +237,9 @@ export class GestureRecognizer extends /** * Performs gesture recognition on the provided video frame and waits - * synchronously for the response. + * synchronously for the response. Only use this method when the + * GestureRecognizer is created with running mode `video`. + * * @param videoFrame A video frame to process. * @param timestamp The timestamp of the current frame, in ms. * @return The detected gestures. diff --git a/mediapipe/tasks/web/vision/hand_landmarker/hand_landmarker.ts b/mediapipe/tasks/web/vision/hand_landmarker/hand_landmarker.ts index 6d69d568..290f4945 100644 --- a/mediapipe/tasks/web/vision/hand_landmarker/hand_landmarker.ts +++ b/mediapipe/tasks/web/vision/hand_landmarker/hand_landmarker.ts @@ -177,7 +177,9 @@ export class HandLandmarker extends VisionTaskRunner { /** * Performs hand landmarks detection on the provided single image and waits - * synchronously for the response. + * synchronously for the response. Only use this method when the + * HandLandmarker is created with running mode `image`. + * * @param image An image to process. * @return The detected hand landmarks. */ @@ -187,7 +189,9 @@ export class HandLandmarker extends VisionTaskRunner { /** * Performs hand landmarks detection on the provided video frame and waits - * synchronously for the response. + * synchronously for the response. Only use this method when the + * HandLandmarker is created with running mode `video`. + * * @param videoFrame A video frame to process. * @param timestamp The timestamp of the current frame, in ms. * @return The detected hand landmarks. diff --git a/mediapipe/tasks/web/vision/image_classifier/image_classifier.ts b/mediapipe/tasks/web/vision/image_classifier/image_classifier.ts index 604795f9..185ddf9e 100644 --- a/mediapipe/tasks/web/vision/image_classifier/image_classifier.ts +++ b/mediapipe/tasks/web/vision/image_classifier/image_classifier.ts @@ -120,7 +120,8 @@ export class ImageClassifier extends VisionTaskRunner { /** * Performs image classification on the provided single image and waits - * synchronously for the response. + * synchronously for the response. Only use this method when the + * ImageClassifier is created with running mode `image`. * * @param image An image to process. * @return The classification result of the image @@ -131,7 +132,8 @@ export class ImageClassifier extends VisionTaskRunner { /** * Performs image classification on the provided video frame and waits - * synchronously for the response. + * synchronously for the response. Only use this method when the + * ImageClassifier is created with running mode `video`. * * @param videoFrame A video frame to process. * @param timestamp The timestamp of the current frame, in ms. diff --git a/mediapipe/tasks/web/vision/image_embedder/image_embedder.ts b/mediapipe/tasks/web/vision/image_embedder/image_embedder.ts index 68068db6..91352e93 100644 --- a/mediapipe/tasks/web/vision/image_embedder/image_embedder.ts +++ b/mediapipe/tasks/web/vision/image_embedder/image_embedder.ts @@ -122,10 +122,8 @@ export class ImageEmbedder extends VisionTaskRunner { /** * Performs embedding extraction on the provided single image and waits - * synchronously for the response. - * - * Only use this method when the `useStreamMode` option is not set or - * expliclity set to `false`. + * synchronously for the response. Only use this method when the + * ImageEmbedder is created with running mode `image`. * * @param image The image to process. * @return The classification result of the image @@ -136,9 +134,8 @@ export class ImageEmbedder extends VisionTaskRunner { /** * Performs embedding extraction on the provided video frame and waits - * synchronously for the response. - * - * Only use this method when the `useStreamMode` option is set to `true`. + * synchronously for the response. Only use this method when the + * ImageEmbedder is created with running mode `video`. * * @param imageFrame The image frame to process. * @param timestamp The timestamp of the current frame, in ms. diff --git a/mediapipe/tasks/web/vision/object_detector/object_detector.ts b/mediapipe/tasks/web/vision/object_detector/object_detector.ts index 0f039acb..7711c39e 100644 --- a/mediapipe/tasks/web/vision/object_detector/object_detector.ts +++ b/mediapipe/tasks/web/vision/object_detector/object_detector.ts @@ -151,7 +151,9 @@ export class ObjectDetector extends VisionTaskRunner { /** * Performs object detection on the provided single image and waits - * synchronously for the response. + * synchronously for the response. Only use this method when the + * ObjectDetector is created with running mode `image`. + * * @param image An image to process. * @return The list of detected objects */ @@ -161,7 +163,9 @@ export class ObjectDetector extends VisionTaskRunner { /** * Performs object detection on the provided vidoe frame and waits - * synchronously for the response. + * synchronously for the response. Only use this method when the + * ObjectDetector is created with running mode `video`. + * * @param videoFrame A video frame to process. * @param timestamp The timestamp of the current frame, in ms. * @return The list of detected objects