Sort vision tasks in README.md
PiperOrigin-RevId: 516312229
This commit is contained in:
parent
85600ca326
commit
eac2e337f6
|
@ -2,23 +2,42 @@
|
||||||
|
|
||||||
This package contains the vision tasks for MediaPipe.
|
This package contains the vision tasks for MediaPipe.
|
||||||
|
|
||||||
## Object Detection
|
## Gesture Recognition
|
||||||
|
|
||||||
The MediaPipe Object Detector task lets you detect the presence and location of
|
The MediaPipe Gesture Recognizer task lets you recognize hand gestures in real
|
||||||
multiple classes of objects within images or videos.
|
time, and provides the recognized hand gesture results along with the landmarks
|
||||||
|
of the detected hands. You can use this task to recognize specific hand gestures
|
||||||
|
from a user, and invoke application features that correspond to those gestures.
|
||||||
|
|
||||||
```
|
```
|
||||||
const vision = await FilesetResolver.forVisionTasks(
|
const vision = await FilesetResolver.forVisionTasks(
|
||||||
"https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm"
|
"https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm"
|
||||||
);
|
);
|
||||||
const objectDetector = await ObjectDetector.createFromModelPath(vision,
|
const gestureRecognizer = await GestureRecognizer.createFromModelPath(vision,
|
||||||
"https://storage.googleapis.com/mediapipe-tasks/object_detector/efficientdet_lite0_uint8.tflite"
|
"https://storage.googleapis.com/mediapipe-tasks/gesture_recognizer/gesture_recognizer.task"
|
||||||
);
|
);
|
||||||
const image = document.getElementById("image") as HTMLImageElement;
|
const image = document.getElementById("image") as HTMLImageElement;
|
||||||
const detections = objectDetector.detect(image);
|
const recognitions = gestureRecognizer.recognize(image);
|
||||||
```
|
```
|
||||||
|
|
||||||
For more information, refer to the [Object Detector](https://developers.google.com/mediapipe/solutions/vision/object_detector/web_js) documentation.
|
## Hand Landmark Detection
|
||||||
|
|
||||||
|
The MediaPipe Hand Landmarker task lets you detect the landmarks of the hands in
|
||||||
|
an image. You can use this Task to localize key points of the hands and render
|
||||||
|
visual effects over the hands.
|
||||||
|
|
||||||
|
```
|
||||||
|
const vision = await FilesetResolver.forVisionTasks(
|
||||||
|
"https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm"
|
||||||
|
);
|
||||||
|
const handLandmarker = await HandLandmarker.createFromModelPath(vision,
|
||||||
|
"https://storage.googleapis.com/mediapipe-tasks/hand_landmarker/hand_landmarker.task"
|
||||||
|
);
|
||||||
|
const image = document.getElementById("image") as HTMLImageElement;
|
||||||
|
const landmarks = handLandmarker.detect(image);
|
||||||
|
```
|
||||||
|
|
||||||
|
For more information, refer to the [Handlandmark Detection](https://developers.google.com/mediapipe/solutions/vision/hand_landmarker/web_js) documentation.
|
||||||
|
|
||||||
## Image Classification
|
## Image Classification
|
||||||
|
|
||||||
|
@ -56,40 +75,21 @@ imageSegmenter.segment(image, (masks, width, height) => {
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
## Gesture Recognition
|
## Object Detection
|
||||||
|
|
||||||
The MediaPipe Gesture Recognizer task lets you recognize hand gestures in real
|
The MediaPipe Object Detector task lets you detect the presence and location of
|
||||||
time, and provides the recognized hand gesture results along with the landmarks
|
multiple classes of objects within images or videos.
|
||||||
of the detected hands. You can use this task to recognize specific hand gestures
|
|
||||||
from a user, and invoke application features that correspond to those gestures.
|
|
||||||
|
|
||||||
```
|
```
|
||||||
const vision = await FilesetResolver.forVisionTasks(
|
const vision = await FilesetResolver.forVisionTasks(
|
||||||
"https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm"
|
"https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm"
|
||||||
);
|
);
|
||||||
const gestureRecognizer = await GestureRecognizer.createFromModelPath(vision,
|
const objectDetector = await ObjectDetector.createFromModelPath(vision,
|
||||||
"https://storage.googleapis.com/mediapipe-tasks/gesture_recognizer/gesture_recognizer.task"
|
"https://storage.googleapis.com/mediapipe-tasks/object_detector/efficientdet_lite0_uint8.tflite"
|
||||||
);
|
);
|
||||||
const image = document.getElementById("image") as HTMLImageElement;
|
const image = document.getElementById("image") as HTMLImageElement;
|
||||||
const recognitions = gestureRecognizer.recognize(image);
|
const detections = objectDetector.detect(image);
|
||||||
```
|
```
|
||||||
|
|
||||||
## Handlandmark Detection
|
For more information, refer to the [Object Detector](https://developers.google.com/mediapipe/solutions/vision/object_detector/web_js) documentation.
|
||||||
|
|
||||||
The MediaPipe Hand Landmarker task lets you detect the landmarks of the hands in
|
|
||||||
an image. You can use this Task to localize key points of the hands and render
|
|
||||||
visual effects over the hands.
|
|
||||||
|
|
||||||
```
|
|
||||||
const vision = await FilesetResolver.forVisionTasks(
|
|
||||||
"https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@latest/wasm"
|
|
||||||
);
|
|
||||||
const handLandmarker = await HandLandmarker.createFromModelPath(vision,
|
|
||||||
"https://storage.googleapis.com/mediapipe-tasks/hand_landmarker/hand_landmarker.task"
|
|
||||||
);
|
|
||||||
const image = document.getElementById("image") as HTMLImageElement;
|
|
||||||
const landmarks = handLandmarker.detect(image);
|
|
||||||
```
|
|
||||||
|
|
||||||
For more information, refer to the [Handlandmark Detection](https://developers.google.com/mediapipe/solutions/vision/hand_landmarker/web_js) documentation.
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user