skip to content
gigarouter gigarouter
models / image segmentation · coming soon

MODNet

Xenova/modnet

published Feb 2024 · updated Oct 2025

MODNet is a real-time portrait matting model that removes backgrounds from images without requiring a trimap.

status
coming soon
API providers
0
downloads / mo
54.3K
license
apache-2.0

specs

TaskImage Segmentation (Portrait Matting)
ArchitectureMODNet (MobileNetV2-based)
LicenseApache-2.0

about this model

MODNet is a segmentation model for real-time, trimap-free portrait matting that predicts an alpha matte from a single RGB image. Designed for efficient inference, it performs matting without requiring a trimap, reducing preprocessing overhead. The model is optimized for practical deployment and has been widely adopted in the community.

Architecture and Output

MODNet uses a lightweight CNN architecture to produce a high-quality alpha matte. The following example shows an input portrait and the corresponding output mask:

Input image Output mask
Portrait input image with a person at the beach Predicted alpha matte mask indicating foreground region

Strengths

  • Trimap-free operation: No user-provided trimap is needed; the model directly predicts the matte from the RGB image.
  • Real-time performance: Suitable for live applications such as video matting and background replacement.
  • Single input: Requires only a standard RGB image, simplifying integration into existing pipelines.

Additional Information

This Hugging Face hosted version provides ONNX weights for cross-platform compatibility. The model is licensed under Apache-2.0. With over 54,000 monthly downloads and 84 community likes, it is a proven choice for portrait matting tasks. For further details, see the AAAI 2022 paper and the official repository.

best for

FAQ

What input format does MODNet expect?

It takes a single RGB image. No trimap or additional input is required.

What does MODNet output?

It outputs an alpha matte (a grayscale mask) that separates foreground (person) from background.

Is MODNet fast enough for real-time use?

Yes, the model is designed for real-time portrait matting on common PCs and mobile devices, with the research demo supporting real-time video.

What is the license for MODNet?

The model is licensed under Apache-2.0, allowing commercial use with attribution.

How can I use MODNet via the gigarouter API?

Send an image to the gigarouter OpenAI-compatible endpoint with your API key. The response will contain the alpha matte.

not yet live

We're benchmarking and onboarding MODNet as a hosted, OpenAI-compatible API. Sign in for free credit and be ready when it lands, or tell us you want it and we'll prioritize it.

related image segmentation models

compare all →