# MediaPipe portrait components

Copyright The MediaPipe Authors. Licensed under Apache License 2.0; see LICENSE.txt.

Unmodified browser distribution: @mediapipe/tasks-vision 0.10.21 (vision_bundle.mjs and SIMD/non-SIMD wasm files), from the official npm package. Package source: https://github.com/google-ai-edge/mediapipe . The original package.json retains upstream package metadata. Only runtime files are included; development sourcemaps and CommonJS bundle are omitted.

Models: Google SelfieSegmenter square float16 version 1 and BlazeFace short-range float16 version 1, fetched from the official Google MediaPipe models bucket. Both official model cards explicitly state Apache License, Version 2.0 on their first page. Corresponding cards are included unchanged as selfie-model-card.pdf and face-model-card.pdf. URLs, sizes and SHA256 are in sources.json.

Runtime assets are self-hosted. Processing photo pixels occurs in the browser. No photo upload or external CDN request is required. Modern WebAssembly and Canvas support is required. CPU inference is used; browser memory and hardware still affect availability and speed. Only the applicable SIMD or non-SIMD runtime is loaded, approximately 10 MB including models and JS; both versions are included in the distribution (approximately 19 MB runtime).

SelfieSegmenter approximates foreground/background boundaries. Thin hair, translucent accessories, low light and complex backgrounds can reduce quality. Face detection is used only for single-face guidance and crop positioning; small faces, occlusion and nonfrontal faces can be missed. It is not identity recognition and does not prove an image is a compliant registration photo. Check the specific registration system requirements.

Integration code and DPI metadata writing are Qinghe code. No HivisionIDPhotos code/model, IMG.LY background-removal code, or AGPL dependency is included here.

Fine portrait matting now uses the separately licensed official MODNet model and ONNX Runtime Web in ../matting/. SelfieSegmenter is an optional lightweight mode; face detection is shared. See ../matting/NOTICE.md for sources and limitations.
