ai.natml.vision.robust-video-matting
v1.0.5
Published
Robust Video Matting for high-fidelity human segmentation in Unity Engine.
Downloads
105
Maintainers
Readme
Robust Video Matting
Robust Video Matting for human segmentation.
Installing Robust Video Matting
Add the following items to your Unity project's Packages/manifest.json
:
{
"scopedRegistries": [
{
"name": "NatML",
"url": "https://registry.npmjs.com",
"scopes": ["ai.natml"]
}
],
"dependencies": {
"ai.natml.vision.robust-video-matting": "1.0.4"
}
}
Predicting the Matte
First, create the Robust Video Matting predictor:
// Create the RVM predictor
var predictor = await RobustVideoMattingPredictor.Create();
Predict the matte for an image:
// Compute the matte
Texture2D image = ...; // This can also be a WebCamTexture or an MLImageFeature
RobustVideoMattingPredictor.Matte matte = predictor.Predict(image);
Finally, render the predicted matte to a RenderTexture
:
// Visualize the matte in a `RenderTexture`
var result = new RenderTexture(image.width, image.height, 0);
matte.Render(result);
Requirements
- Unity 2021.2+
Quick Tips
- Discover more ML models on NatML Hub.
- See the NatML documentation.
- Join the NatML community on Discord.
- Contact us at [email protected].
Thank you very much!