MoveNet multiple body pose detection from Google MediaPipe.
Install Function in your Unity project then 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 poseObjects = prediction.results[0] as JArray;
Finally, parse the detected poses with the Pose
struct:
// Parse the detected poses
Pose[] poses = poseObjects.ToObject<Pose[]>(Pose.Serializer);
Note
Check out the schema of the returned poses.
- Unity 2022.3+
- Android API level 24+
- iOS 14+
- macOS 12+ (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!