Hair Matte Net
Hair matte segmentation. This predictor implements HairMatteNet. This package requires NatML.
Segmenting Hair in an Image
First, create the predictor:
var modelData = await MLModelData.FromHub("@natsuite/hair-matte-net");
var model = modelData.Deserialize();
var predictor = new HairMatteNetPredictor(model);
Then segment hair in an image:
Texture2D image = ...;
HairMatteNetPredictor.Matte matte = predictor.Predict(image);
Finally, render the segmentation map to a RenderTexture
:
var hairMask = new RenderTexture(image.width, image.height, 0);
matte.Render(hairMask);
References
Requirements
Quick Tips
Thank you very much!