-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
337 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
{ | ||
"plugins": [ | ||
["transform-react-remove-prop-types", { | ||
"removeImport": true | ||
}] | ||
], | ||
"presets": ["@babel/preset-env", "@babel/preset-react"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: github pages | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
- run: npm ci | ||
- run: npm run docs:build | ||
- run: echo "react-posenet.yoyota.dev" > ./dist-docs/CNAME | ||
- name: deploy | ||
uses: peaceiris/actions-gh-pages@v2 | ||
env: | ||
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | ||
PUBLISH_BRANCH: gh-pages | ||
PUBLISH_DIR: ./dist-docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,5 @@ yarn-debug.log* | |
yarn-error.log* | ||
|
||
# dist | ||
dist | ||
dist | ||
dist-docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,39 @@ | ||
# React PoseNet | ||
|
||
React PoseNet is a handy wrapper component for [tfjs-models/posenet](https://github.com/tensorflow/tfjs-models/tree/master/posenet) | ||
|
||
## Documentation | ||
|
||
https://react-posenet.yoyota.dev | ||
|
||
## Example | ||
|
||
[pull up counter](https://github.com/yoyota/react-posenet-pull-up) | ||
<img src="https://i.imgur.com/xTP8Otx.gif" width=300 height=300 /> | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install --save react-posenet | ||
``` | ||
|
||
### Usage | ||
|
||
```jsx | ||
import PoseNet from "react-posenet" | ||
|
||
export default function App() { | ||
return <PoseNet /> | ||
} | ||
``` | ||
|
||
## Core Feautres | ||
|
||
### [onEstimate](https://react-posenet.yoyota.dev/#/Props%20examples?id=section-onestimate) | ||
|
||
gets called after estimation. [poses](https://github.com/tensorflow/tfjs-models/tree/master/posenet#keypoints) is a passed parameter | ||
|
||
### [input](https://react-posenet.yoyota.dev/#/Props%20examples?id=section-input) | ||
the input image to feed through the network. see | ||
[tfjs-posenet document](https://github.com/tensorflow/tfjs-models/tree/master/posenet#params-in-estimatesinglepose) | ||
If input is not specified react-posenet try to [getUserMedia](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
- [Github repository](https://github.com/yoyota/react-posenet) | ||
|
||
React PoseNet is a handy wrapper component for [tfjs-models/posenet](https://github.com/tensorflow/tfjs-models/tree/master/posenet) | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install --save react-posenet | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
```jsx | ||
import { useMemo } from "react" | ||
import PoseNet from "react-posenet" | ||
|
||
const input = useMemo(() => { | ||
const image = new Image() | ||
image.crossOrigin = "" | ||
image.src = "https://i.imgur.com/oV2ZNuD.jpg" | ||
return image | ||
}, []) | ||
|
||
;<PoseNet input={input} /> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
If your device dose not have camera, you will see error message like | ||
<font color="red">Requested device not found</font> | ||
|
||
```jsx | ||
import { useState } from "react" | ||
import PoseNet from "react-posenet" | ||
|
||
const [posesString, setPosesString] = useState([]) | ||
|
||
;<> | ||
<PoseNet | ||
inferenceConfig={{ decodingMethod: "single-person" }} | ||
onEstimate={poses => { | ||
setPosesString(JSON.stringify(poses)) | ||
}} | ||
/> | ||
<p>{posesString}</p> | ||
</> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Test3 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.