Enum BackgroundRemovalModel
- Namespace
- VisioForge.Core.Types.X.AI
- Assembly
- VisioForge.Core.dll
The segmentation/matting model family the background-removal block runs. Each family expects a distinct
input size and pixel normalization, so the block must be told which one the supplied .onnx file
belongs to. The model produces a single-channel foreground alpha mask that the block uses to composite the
replacement background.
public enum BackgroundRemovalModelFields
MODNet = 0-
MODNet portrait matting (Apache-2.0). Real-time, designed for webcam/portrait use. Input is resized directly (no letterbox) to a square (default 512x512) and normalized to the -1..1 range (mean 0.5 / std 0.5). The model emits a single alpha matte
[1, 1, H, W]in 0..1. PPMattingV2 = 4-
PP-MattingV2 real-time human matting (PaddleSeg, Apache-2.0). Faster and more accurate than MODNet. Input is resized directly to the model's fixed size and normalized to the -1..1 range (mean 0.5 / std 0.5); the model bakes in the final sigmoid, so the single output
[1, 1, H, W]is already a 0..1 alpha matte. U2Net = 1-
U2-Net salient-object / portrait segmentation (Apache-2.0). Input resized directly to 320x320 and normalized with ImageNet mean/std. The first output is a saliency map whose range varies per image, so the block rescales it to 0..1 by its own per-frame min/max.
BiRefNet = 2-
BiRefNet high-accuracy dichotomous segmentation (MIT code). Heavier (typically run at 1024x1024 -- set
InputWidth/InputHeightaccordingly; the block's 512 default is not BiRefNet's native size), better edges, but not real-time on the CPU. Input resized directly and normalized with ImageNet mean/std. The common ONNX export emits a single raw logit map (unbounded), to which the block applies a sigmoid to obtain the 0..1 alpha matte. Custom = 3-
A custom segmentation model. The block uses the configured input size and normalization from the settings as-is and treats the first float output as the alpha mask. Use this for a model that does not match one of the built-in conventions.
Remarks
Licensing note: VisioForge.Core.Types.X.AI.BackgroundRemovalModel.MODNet, VisioForge.Core.Types.X.AI.BackgroundRemovalModel.PPMattingV2 (PaddleSeg) and VisioForge.Core.Types.X.AI.BackgroundRemovalModel.U2Net are
Apache-2.0; VisioForge.Core.Types.X.AI.BackgroundRemovalModel.BiRefNet code is MIT (verify the specific checkpoint's weights — some are trained
on non-commercial data). The SDK does not ship model weights; the integrator supplies the .onnx file.