Skip to content

Commit c6bcde9

Browse files
authored
Rename hand-detection package to hand-pose-detection (#854)
1 parent 250b679 commit c6bcde9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+62
-62
lines changed
File renamed without changes.

hand-detection/README.md renamed to hand-pose-detection/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Hand Detection
1+
# Hand Pose Detection
22

3-
This package provides multiple models for running real-time hand detection.
3+
This package provides models for running real-time hand pose detection.
44

55
Currently, we provide 1 model option:
66

@@ -22,8 +22,8 @@ including `MediaPipeHands`.
2222
For example:
2323

2424
```javascript
25-
const model = handDetection.SupportedModels.MediaPipeHands;
26-
const detector = await handDetection.createDetector(model);
25+
const model = handPoseDetection.SupportedModels.MediaPipeHands;
26+
const detector = await handPoseDetection.createDetector(model);
2727
```
2828

2929
Then you can use the detector to detect hands.
@@ -62,9 +62,9 @@ The name provides a label for each keypoint, such as 'wrist', 'pinky_tip', etc.
6262
Refer to each model's documentation for specific configurations for the model
6363
and their performance.
6464

65-
[MediaPipeHands MediaPipe Documentation](https://github.com/tensorflow/tfjs-models/tree/master/hand-detection/src/mediapipe)
65+
[MediaPipeHands MediaPipe Documentation](https://github.com/tensorflow/tfjs-models/tree/master/hand-pose-detection/src/mediapipe)
6666

67-
[MediaPipeHands TFJS Documentation](https://github.com/tensorflow/tfjs-models/tree/master/hand-detection/src/tfjs)
67+
[MediaPipeHands TFJS Documentation](https://github.com/tensorflow/tfjs-models/tree/master/hand-pose-detection/src/tfjs)
6868

6969
-------------------------------------------------------------------------------
7070

hand-detection/cloudbuild.yml renamed to hand-pose-detection/cloudbuild.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,33 @@ steps:
66
entrypoint: 'yarn'
77
args: ['install']
88

9-
# Install hand-detection dependencies.
9+
# Install hand-pose-detection dependencies.
1010
- name: 'node:10'
11-
dir: 'hand-detection'
11+
dir: 'hand-pose-detection'
1212
entrypoint: 'yarn'
1313
id: 'yarn'
1414
args: ['install']
1515
waitFor: ['yarn-common']
1616

1717
# Lint.
1818
- name: 'node:10'
19-
dir: 'hand-detection'
19+
dir: 'hand-pose-detection'
2020
entrypoint: 'yarn'
2121
id: 'lint'
2222
args: ['lint']
2323
waitFor: ['yarn']
2424

2525
# Build.
2626
- name: 'node:10'
27-
dir: 'hand-detection'
27+
dir: 'hand-pose-detection'
2828
entrypoint: 'yarn'
2929
id: 'build'
3030
args: ['build']
3131
waitFor: ['yarn']
3232

3333
# Run browser tests.
3434
- name: 'node:10'
35-
dir: 'hand-detection'
35+
dir: 'hand-pose-detection'
3636
entrypoint: 'yarn'
3737
id: 'test'
3838
args: ['test-ci']

hand-detection/demos/README.md renamed to hand-pose-detection/demos/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Demos
22

3-
Try our demos and get inspired with what you can do with hand-detection models!
3+
Try our demos and get inspired with what you can do with hand-pose-detection models!
44

55
## Table of Contents
66
1. [Live Camera Demo](#live-camera-demo)
@@ -14,7 +14,7 @@ This demo uses your camera to get live stream and tracks your hands in real-time
1414
You can try out different runtimes to see the difference. It
1515
works on laptops, iPhones and android phones.
1616

17-
[MediaPipeHands model entry](https://storage.googleapis.com/tfjs-models/demos/hand-detection/index.html?model=mediapipe_hands)
17+
[MediaPipeHands model entry](https://storage.googleapis.com/tfjs-models/demos/hand-pose-detection/index.html?model=mediapipe_hands)
1818

1919
## How to Run a Demo
2020
If you want to run any of the demos locally, follow these steps:

hand-detection/demos/live_video/package.json renamed to hand-pose-detection/demos/live_video/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "handdetection_demo",
2+
"name": "handposedetection_demo",
33
"version": "0.0.1",
4-
"description": "Demo for hand detection api",
4+
"description": "Demo for hand pose detection api",
55
"main": "index.js",
66
"license": "Apache-2.0",
77
"private": true,
@@ -10,7 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@mediapipe/hands": "~0.3.0",
13-
"@tensorflow-models/hand-detection": "file:../../dist",
13+
"@tensorflow-models/hand-pose-detection": "file:../../dist",
1414
"@tensorflow/tfjs-backend-wasm": "^3.9.0",
1515
"@tensorflow/tfjs-backend-webgl": "^3.9.0",
1616
"@tensorflow/tfjs-converter": "^3.9.0",

hand-detection/demos/live_video/src/index.js renamed to hand-pose-detection/demos/live_video/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ tfjsWasm.setWasmPaths(
2424
`https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-wasm@${
2525
tfjsWasm.version_wasm}/dist/`);
2626

27-
import * as handdetection from '@tensorflow-models/hand-detection';
27+
import * as handdetection from '@tensorflow-models/hand-pose-detection';
2828

2929
import {Camera} from './camera';
3030
import {setupDatGui} from './option_panel';

hand-detection/demos/live_video/src/option_panel.js renamed to hand-pose-detection/demos/live_video/src/option_panel.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
* =============================================================================
1616
*/
17-
import * as handdetection from '@tensorflow-models/hand-detection';
17+
import * as handdetection from '@tensorflow-models/hand-pose-detection';
1818
import * as tf from '@tensorflow/tfjs-core';
1919

2020
import * as params from './params';

hand-detection/demos/live_video/src/params.js renamed to hand-pose-detection/demos/live_video/src/params.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
* =============================================================================
1616
*/
17-
import * as handdetection from '@tensorflow-models/hand-detection';
17+
import * as handdetection from '@tensorflow-models/hand-pose-detection';
1818

1919
export const DEFAULT_LINE_WIDTH = 2;
2020
export const DEFAULT_RADIUS = 4;
File renamed without changes.

hand-detection/package.json renamed to hand-pose-detection/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "@tensorflow-models/hand-detection",
2+
"name": "@tensorflow-models/hand-pose-detection",
33
"version": "0.0.1",
4-
"description": "Pretrained hand detection model",
4+
"description": "Pretrained hand pose detection model",
55
"main": "dist/index.js",
6-
"jsnext:main": "dist/hand-detection.esm.js",
7-
"module": "dist/hand-detection.esm.js",
8-
"unpkg": "dist/hand-detection.min.js",
9-
"jsdelivr": "dist/hand-detection.min.js",
6+
"jsnext:main": "dist/hand-pose-detection.esm.js",
7+
"module": "dist/hand-pose-detection.esm.js",
8+
"unpkg": "dist/hand-pose-detection.min.js",
9+
"jsdelivr": "dist/hand-pose-detection.min.js",
1010
"types": "dist/index.d.ts",
1111
"repository": {
1212
"type": "git",

hand-detection/rollup.config.js renamed to hand-pose-detection/rollup.config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ function config({ plugins = [], output = {}, tsCompilerOptions = {} }) {
6666
};
6767
}
6868

69-
const packageName = 'handDetection';
69+
const packageName = 'handPoseDetection';
7070
export default [
71-
config({ output: { format: 'umd', name: packageName, file: 'dist/hand-detection.js' } }),
71+
config({ output: { format: 'umd', name: packageName, file: 'dist/hand-pose-detection.js' } }),
7272
config({
7373
plugins: [terser({output: {preamble: PREAMBLE, comments: false}})],
74-
output: { format: 'umd', name: packageName, file: 'dist/hand-detection.min.js' }
74+
output: { format: 'umd', name: packageName, file: 'dist/hand-pose-detection.min.js' }
7575
}),
7676
config({
7777
plugins: [terser({output: {preamble: PREAMBLE, comments: false}})],
78-
output: { format: 'es', file: 'dist/hand-detection.esm.js' }
78+
output: { format: 'es', file: 'dist/hand-pose-detection.esm.js' }
7979
})
8080
];

hand-detection/run_tests.ts renamed to hand-pose-detection/run_tests.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ process.on('unhandledRejection', e => {
3030
});
3131

3232
jasmine_util.setTestEnvs(
33-
[{name: 'test-hand-detection', backendName: 'cpu', flags: {}}]);
33+
[{name: 'test-hand-pose-detection', backendName: 'cpu', flags: {}}]);
3434

3535
const unitTests = 'src/**/*_test.ts';
3636

File renamed without changes.

hand-detection/src/mediapipe/README.md renamed to hand-pose-detection/src/mediapipe/README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,31 @@ Via script tags:
1919

2020
```html
2121
<script src="https://cdn.jsdelivr.net/npm/@mediapipe/hands"></script>
22-
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/hand-detection"></script>
22+
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/hand-pose-detection"></script>
2323
```
2424

2525
Via npm:
2626
```sh
27-
yarn add @tensorflow-models/hand-detection
27+
yarn add @tensorflow-models/hand-pose-detection
2828
yarn add @mediapipe/hands
2929
```
3030

3131
-----------------------------------------------------------------------
3232
## Usage
3333

34-
If you are using the hand-detection API via npm, you need to import the libraries first.
34+
If you are using the hand-pose-detection API via npm, you need to import the libraries first.
3535

3636
### Import the libraries
3737

3838
```javascript
39-
import * as handDetection from '@tensorflow-models/hand-detection';
39+
import * as handPoseDetection from '@tensorflow-models/hand-pose-detection';
4040
import '@mediapipe/hands';
4141
```
4242

4343
### Create a detector
4444

45-
Pass in `handDetection.SupportedModels.MediaPipeHands` from the
46-
`handDetection.SupportedModel` enum list along with a `detectorConfig` to the
45+
Pass in `handPoseDetection.SupportedModels.MediaPipeHands` from the
46+
`handPoseDetection.SupportedModel` enum list along with a `detectorConfig` to the
4747
`createDetector` method to load and initialize the model.
4848

4949
`detectorConfig` is an object that defines MediaPipeHands specific configurations for `MediaPipeHandsMediaPipeModelConfig`:
@@ -58,12 +58,12 @@ Pass in `handDetection.SupportedModels.MediaPipeHands` from the
5858
* *solutionPath*: The path to where the wasm binary and model files are located.
5959

6060
```javascript
61-
const model = handDetection.SupportedModels.MediaPipeHands;
61+
const model = handPoseDetection.SupportedModels.MediaPipeHands;
6262
const detectorConfig = {
6363
runtime: 'mediapipe',
6464
solutionPath: 'base/node_modules/@mediapipe/hands'
6565
};
66-
detector = await handDetection.createDetector(model, detectorConfig);
66+
detector = await handPoseDetection.createDetector(model, detectorConfig);
6767
```
6868

6969
### Run inference

hand-detection/src/mediapipe/mediapipe_test.ts renamed to hand-pose-detection/src/mediapipe/mediapipe_test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {BROWSER_ENVS, describeWithFlags} from '@tensorflow/tfjs-core/dist/jasmin
2020
// tslint:disable-next-line: no-imports-from-dist
2121
import {expectArraysClose} from '@tensorflow/tfjs-core/dist/test_util';
2222

23-
import * as handDetection from '../index';
23+
import * as handPoseDetection from '../index';
2424
import {loadImage} from '../shared/test_util';
2525

2626
import {MediaPipeHandsMediaPipeModelConfig} from './types';
@@ -50,7 +50,7 @@ const EXPECTED_HAND_KEYPOINTS_PREDICTION = [
5050
];
5151

5252
describeWithFlags('MediaPipe Hands multi hands ', BROWSER_ENVS, () => {
53-
let detector: handDetection.HandDetector;
53+
let detector: handPoseDetection.HandDetector;
5454
let image: HTMLImageElement;
5555
let timeout: number;
5656

@@ -66,9 +66,9 @@ describeWithFlags('MediaPipe Hands multi hands ', BROWSER_ENVS, () => {
6666

6767
it('test.', async () => {
6868
// Note: this makes a network request for model assets.
69-
const model = handDetection.SupportedModels.MediaPipeHands;
69+
const model = handPoseDetection.SupportedModels.MediaPipeHands;
7070
detector =
71-
await handDetection.createDetector(model, MEDIAPIPE_MODEL_CONFIG);
71+
await handPoseDetection.createDetector(model, MEDIAPIPE_MODEL_CONFIG);
7272

7373
const result = await detector.estimateHands(image, {staticImageMode: true});
7474
const keypoints = result.map(
File renamed without changes.

hand-detection/src/tfjs/README.md renamed to hand-pose-detection/src/tfjs/README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,25 @@ MediaPipeHands-TFJS uses TF.js runtime to execute the model, the preprocessing a
1414
To use MediaPipeHands, you need to first select a runtime (TensorFlow.js or MediaPipe).
1515
This guide is for TensorFlow.js
1616
runtime. The guide for MediaPipe runtime can be found
17-
[here](https://github.com/tensorflow/tfjs-models/tree/master/hand-detection/src/mediapipe).
17+
[here](https://github.com/tensorflow/tfjs-models/tree/master/hand-pose-detection/src/mediapipe).
1818

1919
Via script tags:
2020

2121
```html
22-
<!-- Require the peer dependencies of hand-detection. -->
22+
<!-- Require the peer dependencies of hand-pose-detection. -->
2323
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-core"></script>
2424
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-converter"></script>
2525

2626
<!-- You must explicitly require a TF.js backend if you're not using the TF.js union bundle. -->
2727
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-backend-webgl"></script>
2828

29-
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/hand-detection"></script>
29+
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/hand-pose-detection"></script>
3030
```
3131

3232
Via npm:
3333

3434
```sh
35-
yarn add @tensorflow-models/hand-detection
35+
yarn add @tensorflow-models/hand-pose-detection
3636
yarn add @tensorflow/tfjs-core, @tensorflow/tfjs-converter
3737
yarn add @tensorflow/tfjs-backend-webgl
3838
```
@@ -45,15 +45,15 @@ If you are using the Hands API via npm, you need to import the libraries first.
4545
### Import the libraries
4646

4747
```javascript
48-
import * as handDetection from '@tensorflow-models/hand-detection';
48+
import * as handPoseDetection from '@tensorflow-models/hand-pose-detection';
4949
import * as tf from '@tensorflow/tfjs-core';
5050
// Register WebGL backend.
5151
import '@tensorflow/tfjs-backend-webgl';
5252
```
5353
### Create a detector
5454

55-
Pass in `handDetection.SupportedModels.MediaPipeHands` from the
56-
`handDetection.SupportedModel` enum list along with a `detectorConfig` to the
55+
Pass in `handPoseDetection.SupportedModels.MediaPipeHands` from the
56+
`handPoseDetection.SupportedModel` enum list along with a `detectorConfig` to the
5757
`createDetector` method to load and initialize the model.
5858

5959
`detectorConfig` is an object that defines MediaPipeHands specific configurations for `MediaPipeHandsTfjseModelConfig`:
@@ -71,11 +71,11 @@ the detector model. This is useful for area/countries that don't have access to
7171
the landmark model. This is useful for area/countries that don't have access to the model hosted on tf.hub.
7272

7373
```javascript
74-
const model = handDetection.SupportedModels.MediaPipeHands;
74+
const model = handPoseDetection.SupportedModels.MediaPipeHands;
7575
const detectorConfig = {
7676
runtime: 'tfjs',
7777
};
78-
detector = await handDetection.createDetector(model, detectorConfig);
78+
detector = await handPoseDetection.createDetector(model, detectorConfig);
7979
```
8080

8181
### Run inference
@@ -89,7 +89,7 @@ options, you can pass in a second `estimationConfig` parameter.
8989

9090
* *flipHorizontal*: Optional. Defaults to false. When image data comes from camera, the result has to flip horizontally.
9191

92-
* *staticImageMode*: Optional. Defaults to false. If set to true, hand detection
92+
* *staticImageMode*: Optional. Defaults to false. If set to true, hand pose detection
9393
will run on every input image, otherwise if set to false then detection runs
9494
once and then the model simply tracks those landmarks without invoking
9595
another detection until it loses track of any of the hands (ideal for videos).
@@ -102,5 +102,5 @@ const hands = await detector.estimateHands(image, estimationConfig);
102102
```
103103

104104
Please refer to the Hands API
105-
[README](https://github.com/tensorflow/tfjs-models/blob/master/hand-detection/README.md#how-to-run-it)
105+
[README](https://github.com/tensorflow/tfjs-models/blob/master/hand-pose-detection/README.md#how-to-run-it)
106106
about the structure of the returned `hands`.

0 commit comments

Comments
 (0)