1 Commits
Author SHA1 Message Date
selikhovandClaude Opus 5.5 146502c9ca voelin-media: find the person for the studio's background replacement
Blur, image and colour backgrounds were cut around a centred oval: no
segmentation model was in the build. `segment::HumanSeg` (feature
`segment`, on by default) now runs PP-HumanSeg, PaddleSeg's portrait
segmentation model as OpenCV Zoo ships it (Apache-2.0, 6 MB, bundled in
crates/voelin-media/models with its licence and SHA-256), on the CPU with
tract-onnx: the frame squeezed to 192x192 RGB, the probability of a person
per pixel out as the mask. It is the default segmenter; the model is
parsed and optimised once per process on the segmentation thread, and if
it does not load the oval stands in. Builds without the feature keep the
oval.

One mask takes about 50 ms on one core (tract is optimised in dev builds
too, as voelin-media already is; unoptimised it took 430 ms), so the 10
masks a second cost about half a core. A new test checks the model loads,
the mask size, that an empty evenly lit room has next to nobody in it, and
the time per mask; the frame-path tests now use the oval explicitly, since
they need a mask known in advance. On a photo of a person the mask
follows the silhouette, arms and legs included (checked by eye; the photo
is not committed). Not yet tried with a camera.

The notices list the model and its licence; THIRD_PARTY_NOTICES.md is
regenerated for tract and its dependencies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 18:22:56 +03:00