Background Mask/Segmentation
- Category
- WebRTC
- Type
- New or changed feature
- Status
- No active development (Chrome No active development)
- Intent stage
- None
Summary
The Background Segmentation/Mask API allows web developers to use the native platform's API for camera leveraging on-device AI models for background segmentation. Today, on Windows/Apple, this can leverage NPU and bring power and performance gains. This extends our previously proposed Background Blur API [1] with some implementation difference [2] - * BG Blur preprocesses video frames and replaces the original video frames with ones with background blurred thus the original video frames become unavailable from a web application point of view (until BG Blur is disabled) * BG MASK retains the original frames intact, does segmentation and provides mask frames in addition to the original video frames thus web applications receive both the original frames and mask frames in the same video frame stream. In many cases, it might be important to have access to the original camera feed [3]. Green Screen, Background Replacement (with an Image) and many other use cases can be enabled [4] using this feature. [1] https://developer.chrome.com/blog/background-blur/ [2] https://github.com/riju/backgroundBlur/blob/main/explainer.md#blur-vs-mask [3] https://github.com/w3c/mediacapture-extensions/issues/118#issuecomment-1772204182 [4] https://github.com/riju/backgroundBlur/blob/main/explainer.md#demo
Motivation
A vast majority of communication these days happens on our client devices and features like Blur, Background Replacement, Green Screen have become table stakes. On the Web, due to a lack of a standardized API for Background Segmentation Mask and widespread demand, developers have no options but to use ML frameworks, WASM libraries and bring their own models. This Background Segmentation-Mask API gives developers a choice to use the native platform's API and leverage the on-device AI models already present in the platform.
Standards & signals
- Specification: https://github.com/w3c/mediacapture-extensions/pull/142
- Firefox: No signal
- Safari: No signal
- Web developers: No signals
Ecosystem
- Web Platform Tests: https://wpt.fyi/results/?q=background-mask-segmentation
- Chrome Platform Showcase: https://chrome-platform-showcase.paulkinlan-ea.deno.net/features
- GenDN reference: https://gendn.paulkinlan-ea.deno.net/features
- chrome.dev demos search: https://www.google.com/search?q=site%3Achrome.dev+Background%20Mask%2FSegmentation
- MDN Web Docs: https://developer.mozilla.org/en-US/search?q=Background%20Mask%2FSegmentation
- Baseline status: https://webstatus.dev/?q=Background%20Mask%2FSegmentation
Explainers: https://github.com/riju/backgroundBlur/blob/main/explainer.md#background-segmentation-mask-api