MediaPipe Meet Segmentation for human matting in Unity Engine.
Add the following items to your Unity project's Packages/manifest.json
:
{
"scopedRegistries": [
{
"name": "NatML",
"url": "https://registry.npmjs.com",
"scopes": ["ai.natml", "ai.fxn"]
}
],
"dependencies": {
"ai.natml.vision.meet": "1.0.7"
}
}
First, create the predictor:
// Create the Meet predictor
var predictor = await MeetPredictor.Create();
Then predict the human matte:
// Given an image...
Texture2D image = ...;
// Predict the human matte
MeetPredictor.Matte matte = predictor.Predict(image);
Finally, render the segmentation map to a RenderTexture
:
// Create a destination `RenderTexture`
var result = new RenderTexture(image.width, image.height, 0);
// Visualize the map into a `RenderTexture`
matte.Render(result);
- Unity 2022.3+
- Join the NatML community on Discord.
- Discover more ML models on NatML Hub.
- See the NatML documentation.
- Contact us at hi@natml.ai.
Thank you very much!