HivisionIDPhotos  by Zeyi-Lin

AI tool for generating ID photos

created 2 years ago
18,678 stars

Top 2.4% on sourcepulse

GitHubView on GitHub
Project Summary

HivisionIDPhotos is a lightweight, efficient AI-powered tool for creating standard ID photos. It targets users needing quick, high-quality ID photos, offering offline processing and customizable output formats.

How It Works

The tool utilizes a pipeline of AI models for tasks like background removal (matting) and face detection. It supports multiple matting models (MODNet, hivision_modnet, rmbg-1.4, birefnet-v1-lite) and face detection models (MTCNN, RetinaFace, Face++ API), allowing users to balance speed and accuracy. The system can generate standard ID photos, print-ready layouts, and supports features like background color changes and beautification.

Quick Start & Requirements

  • Install: Clone the repository and install dependencies via pip install -r requirements.txt and pip install -r requirements-app.txt.
  • Models: Download model weights using python scripts/download_model.py --models all or manually.
  • Run: Launch the Gradio demo with python app.py.
  • Prerequisites: Python >= 3.7 (tested on 3.10), Linux, Windows, macOS. Optional GPU acceleration requires CUDA and cuDNN.
  • Docs: README_EN.md, API Documentation, Gradio Demo.

Highlighted Details

  • Lightweight, CPU-first inference for matting.
  • Supports multiple AI models for matting and face detection.
  • Generates standard ID photos and print layouts (e.g., 6-inch photo paper).
  • Offers an API service and Docker deployment.
  • Gradio demo includes features like print layout options, custom background colors, and face alignment.

Maintenance & Community

The project is actively maintained with frequent updates. A vibrant community contributes extensions like ComfyUI workflows, WeChat mini-programs, and a C++ version. Links to community projects and contact information are provided.

Licensing & Compatibility

Licensed under the Apache-2.0 License, permitting commercial use and integration with closed-source projects.

Limitations & Caveats

GPU acceleration is primarily supported for the birefnet-v1-lite model and requires significant VRAM (around 16GB). Some advanced features like "smart suit changing" are marked as "waiting." CPU inference times can vary significantly depending on the chosen models.

Health Check
Last commit

3 weeks ago

Responsiveness

1 day

Pull Requests (30d)
3
Issues (30d)
2
Star History
3,144 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.