-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
83eb239
commit fee6237
Showing
24 changed files
with
1,962 additions
and
594 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
Large diffs are not rendered by default.
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
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
## 1.0.3 | ||
+ Upgraded to NatML 1.1.16. | ||
|
||
## 1.0.2 | ||
+ Refactored `BlazePoseDetector.Pose` struct to `Detection`. | ||
|
||
|
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,5 +1,5 @@ | ||
# BlazePose Detector | ||
[MediaPipe BlazePose](https://google.github.io/mediapipe/solutions/pose.html) for person detection in Unity Engine with [NatML](https://github.com/natmlx/NatML). | ||
[MediaPipe BlazePose](https://google.github.io/mediapipe/solutions/pose.html) for person detection in Unity Engine with [NatML](https://github.com/natmlx/natml-unity). | ||
|
||
## Installing BlazePose | ||
Add the following items to your Unity project's `Packages/manifest.json`: | ||
|
@@ -9,48 +9,39 @@ Add the following items to your Unity project's `Packages/manifest.json`: | |
{ | ||
"name": "NatML", | ||
"url": "https://registry.npmjs.com", | ||
"scopes": ["ai.natml"] | ||
"scopes": ["ai.fxn", "ai.natml"] | ||
} | ||
], | ||
"dependencies": { | ||
"ai.natml.vision.blazepose.detector": "1.0.2" | ||
"ai.natml.vision.blazepose.detector": "1.0.3" | ||
} | ||
} | ||
``` | ||
|
||
## Detecting Poses in an Image | ||
First, create the BlazePose detector: | ||
```csharp | ||
// Fetch the model data from NatML | ||
var modelData = await MLModelData.FromHub("@natml/blazepose-detector"); | ||
// Deserialize the model | ||
var model = modelData.Deserialize(); | ||
// Create the BlazePose detector | ||
var predictor = new BlazePoseDetector(model); | ||
var predictor = await BlazePoseDetector.Create(); | ||
``` | ||
|
||
Then detect pose rectangles in the image: | ||
```csharp | ||
// Create image feature | ||
Texture2D image = ...; | ||
var imageFeature = new MLImageFeature(image); | ||
// Set normalization and aspect mode | ||
(imageFeature.mean, imageFeature.std) = modelData.normalization; | ||
imageFeature.aspectMode = modelData.aspectMode; | ||
// Detect pose regions-of-interest in the image | ||
BlazePoseDetector.Detection[] faces = predictor.Predict(imageFeature); | ||
BlazePoseDetector.Detection[] faces = predictor.Predict(image); | ||
``` | ||
|
||
___ | ||
|
||
## Requirements | ||
- Unity 2021.2+ | ||
- Unity 2022.3+ | ||
|
||
## Quick Tips | ||
- Join the [NatML community on Discord](https://hub.natml.ai/community). | ||
- Discover more ML models on [NatML Hub](https://hub.natml.ai). | ||
- See the [NatML documentation](https://docs.natml.ai/unity). | ||
- Discuss [NatML on Unity Forums](https://forum.unity.com/threads/open-beta-natml-machine-learning-runtime.1109339/). | ||
- Contact us at [[email protected]](mailto:[email protected]). | ||
|
||
Thank you very much! |
Oops, something went wrong.