Deep image matting in the browser
Trimap-based alpha matting with a lightweight model (EfficientNet-B0 encoder, U-Net-style decoder, 4.3M parameters, trained on AM-2k), compared against the VGG-16 Deep Image Matting baseline in the project repository. The model runs entirely in your browser with ONNX Runtime Web: your images are never uploaded.
- Provide an image and either a trimap (white = foreground, black = background, gray = unknown) or a rough black/white mask, which is turned into a trimap by marking a band around its boundary as unknown.
- The model needs the trimap: it fills in fractional opacity (fur, hair, edges) inside the unknown band.
Try an example:
Example photos are from the AM-2k dataset (Li et al., IJCV 2021; MIT-licensed release, image copyrights belong to their original owners).