Models About & Code

Standalone App & PWA

Install Portrait Studio from its dedicated origin as an offline desktop or mobile PWA with direct OS image/* file_handlers support and zero camera/microphone permissions.

Open portrait.webai.show ↗

Honest cache note: browsers isolate Cache Storage per origin, so portrait.webai.show caches its own ~32.30 MB base ONNX weights (~39.57 MB with optional eDifFIQA). Staying on webai.show shares cached weights with the YuNet, eDifFIQA, U-2-Netp, and ViTMatte model pages.

US 2×2" · 51×51 mm · 512×512 Mode: Split Compare

Interactive Portrait Studio canvas displaying the framed portrait with ICAO eye-line and headroom reticle.

Original Matted
38%

Loading Daylight Headshot… Every pixel stays strictly on your device.

Print-Room Exports

6-up · 4×6" @ 300 DPI (1200×1800 px)

Export the framed portrait directly or run ViTMatte above to unlock lossless hair-strand alpha PNGs.

Framing & ICAO Reticle

Awaiting YuNet
0.0°
100%
    Optional · Off Scores aligned 112×112 face lighting, sharpness & pose (0..1) on CPU WASM.

    Hair-Strand Trimap Brush

    0% Unknown
    18 px
    16 px
    1 px

    Studio Backdrops

    Pure White

    Local AI Engine

    Three core CPU WebAssembly models (~32.30 MB base) plus optional Stage 1b eDifFIQA biometric audit (+7.27 MB, ~39.57 MB combined) — zero WebGPU, zero camera/mic, zero cloud uploads.

    Stage 1 · YuNet 5-Landmark Face Detector (0.23 MB fp32 · MIT)

    opencv/face_detection_yunet · onnxruntime-web 1.21.0

    Stage 2 · U-2-Netp Portrait Saliency (4.57 MB fp32 · Apache-2.0)

    BritishWerewolf/U-2-Netp · onnxruntime-web 1.21.0

    Stage 3 · ViTMatte-Small Hair Matting (27.50 MB q8 · Apache-2.0)

    Xenova/vitmatte-small-distinctions-646 · Transformers.js 3.7.5

    Optional Stage 1b · eDifFIQA(T) Biometric Quality Audit (7.27 MB fp32 · Apache-2.0)

    opencv/face_image_quality_assessment_ediffiqa · onnxruntime-web 1.21.0 · Downloaded only when Stage 1b audit is requested.

    Stage 1 · YuNet Not run
    Stage 1b · eDifFIQA Optional · Off
    Stage 2 · U-2-Netp + EDT Not run
    Stage 3 · ViTMatte q8 Not run
    Integrity & Sheet 0 NaN · 1200×1800

    How Portrait Studio Works

    Four audited browser-runnable ONNX models run off the main thread in isolated FIFO Web Workers, chaining landmark eye leveling, optional biometric quality scoring, Euclidean trimap synthesis, and 4-channel Vision Transformer hair-strand matting completely offline.

    1. Eye-Line Roll & ICAO Reticle

    OpenCV YuNet (opencv/face_detection_yunet, 0.23 MB fp32, onnxruntime-web 1.21.0, MIT) detects faces and 5 facial landmarks (eyes, nose, mouth corners) to compute roll leveling and live US 2×2" / EU 35×45 mm / Press Badge headroom telemetry.

    1b. Optional Biometric Audit

    OpenCV eDifFIQA(T) (opencv/face_image_quality_assessment_ediffiqa, 7.27 MB fp32 binary / 7.0 MB catalogued, onnxruntime-web 1.21.0, Apache-2.0) scores the aligned 112×112 face crop (0..1) to flag harsh shadows, blur, or pose issues before printing.

    2. Saliency & Euclidean Trimap

    U-2-Netp (BritishWerewolf/U-2-Netp, 4.57 MB fp32, onnxruntime-web 1.21.0, Apache-2.0) produces a coarse 320×320 portrait mask converted off-thread via exact O(W·H) Euclidean erosion/dilation into an editable 3-tone trimap (0 BG / 128 Unknown / 255 FG).

    3. Hair-Strand Alpha Matting

    ViTMatte-Small (Distinctions-646) (Xenova/vitmatte-small-distinctions-646, 27.50 MB q8, Transformers.js 3.7.5, Apache-2.0) solves continuous 8-bit alpha across flyaway hair strands and collar edges for transparent PNG, WebP, and 300 DPI 4×6" contact-sheet prints.

    Show the code — computePortraitFraming() YuNet 5-landmark eye leveling & ICAO geometry
    Show the code — buildTrimapFromSaliency() exact O(W·H) Euclidean erosion/dilation trimap
    Show the code — computePrintSheetLayout() & renderPrintSheet() 4×6" @ 300 DPI cut-guide sheet
    Show the code — Off-main-thread trimap EDT & alpha backdrop compositing worker
    Show the code — StageWorkerClient FIFO queue & lifecycle-safe multi-worker reuse

    4×6" Cut-Guide Print Sheet (300 DPI)

    1200×1800 px lossless PNG ready for photo kiosks or home printers.