finds.dev← search

// the find

Zeyi-Lin/HivisionIDPhotos

★ 21,165 · Python · Apache-2.0 · updated Mar 2026

⚡️HivisionIDPhotos: a lightweight and efficient AI ID photos tools. 一个轻量级的AI证件照制作算法。

HivisionIDPhotos generates compliant ID/passport photos from a regular photo: background removal, face centering, background color replacement, layout tiling for printing. It runs entirely offline on CPU using ONNX models. Aimed at developers who want to self-host or embed ID photo processing into a WeChat mini-program or internal tool.

CPU-only inference with MODNet+MTCNN is genuinely fast (200ms on M1 for a 512x715 image) and the ONNX runtime means no PyTorch dependency for the default path. Multiple matting models with real quality tradeoffs documented — MODNet for speed, BiRefNet for accuracy, with actual benchmark numbers. FastAPI backend plus Gradio frontend are independently launchable, so you can drop the UI and just hit the REST endpoint. Docker image is published to DockerHub and the docker-compose sets up both services in one command.

BiRefNet needs 6GB+ RAM and 7 seconds per photo on CPU — that's a wall if you pick the 'best quality' model in production without GPU. The face detection default (MTCNN) has explicitly acknowledged low accuracy; RetinaFace is better but requires a separate model download and is seconds-per-photo on CPU. No tests beyond a single script in /test — the core image pipeline has zero automated coverage, so regressions after model updates are silent. Beauty features (skin smoothing, whitening, face slimming) are included but the implementation is basic OpenCV/LUT work that will look cheap on anything but ideal input photos.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →