MoveNet multiple body pose detection from Google MediaPipe.
To use this sample in a custom project, first install Function by adding the following items to your Unity project's Packages/manifest.json
:
{
"scopedRegistries": [
{
"name": "Function",
"url": "https://registry.npmjs.com",
"scopes": ["ai.fxn"]
}
],
"dependencies": {
"ai.fxn.fxn3d": "0.0.12"
}
}
First, retrieve your access key from Function and add it in Player Settings:
Important
After some time, you will need to add billing info to make predictions with Function.
Next, create a Function client:
using Function;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
// Create a Function client
var fxn = FunctionUnity.Create();
Then predict the poses in an image:
// Predict poses
var prediction = await fxn.Predictions.Create(
tag: "@natml/movenet-multipose",
inputs: new () { ["image"] = image.ToImage() }
);
var poses = prediction.results[0] as JArray;
Note
Check out the schema of the returned poses.
- Unity 2021.2+
- Android API level 24+
- iOS 14+
- macOS 10.15+ (Apple Silicon and Intel)
- Windows 10+ (64-bit only)
- WebGL:
- Chrome 91+
- Firefox 90+
- Safari 16.4+
- Join the Function community on Discord.
- See the Function documentation.
- Check out Function on GitHub.
- Email support at [email protected].
Thank you very much!