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:
var predictor = await RobustVideoMattingPredictor.Create();
Predict the matte for an image:
Texture2D image = ...;
RobustVideoMattingPredictor.Matte matte = predictor.Predict(image);
Finally, render the predicted matte to a RenderTexture
:
var result = new RenderTexture(image.width, image.height, 0);
matte.Render(result);
Requirements
Quick Tips
Thank you very much!