BATS - SmartMask
Cut a person or object out of the frame with AI – as a luma mask for the EDIUS Track Matte
SmartMask isolates the person or the object in the frame automatically using AI (model BiRefNet, Nvidia GPU accelerated) and saves the result as a luma mask (a black-and-white mask video). This mask can be used directly with EDIUS’s “Track Matte” – for example to place titles or graphics behind a person, to swap the person, or to retouch contours. No more manual masking clip by clip.
Adding the menu entry
“SmartMask” is added through the “Add function...” assistant (right-click in the BIN → Add function... → pick SmartMask - foreground extract). The assistant’s questions:
- What should be isolated? (“Please select the preference what you like to isolate”): Person (model BiRefNet-portrait, optimized for portraits/main subject) or Object and Person (model BiRefNet, general purpose).
- Computation resolution (percent, 10–100, default 100): for accelerated mask calculation, a reduced resolution is used internally (e.g. 1080p → 540p at a factor of 50 %); the result is then extrapolated back to the source resolution. The smaller the factor, the faster – at the cost of precision. The internal size is limited to a maximum of 1024 px in any case.
-
Add the result to the BIN?: Yes → the mask is registered in the BIN under __BAT Server\Mask (MP4, file stamp
-mask); No → file only. - Placement (BIN or timeline) and name (suggestion: “SmartMask <selection> <%>”), then [Preview '.bat0' file] / [Add menu entry].
How to use it
- Right-click the clip (BIN or timeline) → Mask submenu → your entry (e.g. “SmartMask Person 100%”).
- BAT Server lets BiRefNet compute the foreground mask – a finished mask video (white = foreground, black = background) as an MP4, optionally registered in the BIN under __BAT Server\Mask.
- In EDIUS: put the original clip in the track matte level and the generated mask below it (or vice versa, depending on the desired logic) – with “Track Matte” the object is cut out cleanly, e.g. to run text behind it.
Good to know
- Person vs. object: the BiRefNet-portrait model (the “Person” option) is specialized for humans and delivers the cleanest results for portrait shots; choose “Object and Person” for products, vehicles or other items.
- Use the computation resolution wisely: 100 % (default) is the most precise but takes longest – and with source material above 1024 px, BiRefNet downscales to a maximum of 1024 px internally anyway. For material with a clearly delimited foreground (plain background, few fine hairs/edges), 50–75 % is is often a good speed/quality compromise.
- The result is a luma mask: the mask video is a normal video that EDIUS can ingest (MP4) – the information lives in the luminance channel. Fine-tuning (blur, re-touching) is possible directly in EDIUS.
- Interlaced sources: the field order is passed to the plugin; for clean masks, progressive material (or deinterlacing beforehand, see Deinterlace) is the best route.
- Nvidia GPU: BiRefNet runs on the Nvidia GPU – without a suitable GPU the entry is not really usable.
Managing the preset
Entries created via the assistant are user presets: the .bat0 file lives under C:\ProgramData\EdiusPowerTools\BAT-server\bat_files\BIN\ or …\bat_files\timeline\ depending on your choice, and can be freely edited, renamed or deleted (deleting removes the context-menu entry). Model, computation resolution and BIN registration are baked into the .bat0 – changes (e.g. a different percentage) take effect from the next run; for a different combination, simply create a second entry.