3 min read

HivisionIDPhotos: Make Passport and ID Photos Offline (GitHub, Scanned)

Turn an ordinary portrait into a correctly sized ID photo with a clean background, offline on CPU.

HivisionIDPhotos logo
✅
Scan: safe. Nothing to warn about. A small Python project that runs offline; the one cloud option, Face++ face detection, is off unless you configure it. Scanned Oct 26, 2026; the full report is below.

HivisionIDPhotos turns a normal photo of a person into a standard ID photo. It finds the face, cuts the person out from the background, straightens and crops to the size you choose, fills in a plain background colour, and can lay several copies out on a 6-inch or A4 sheet for printing. A Gradio web page on your own machine does all of it with a few clicks.

It is on the list because it is small and private: about 10,000 lines of Python, with matting models of around 25 MB that run on a CPU in a fraction of a second. Nothing has to leave your computer, which matters for a photo of your face going onto an official document. There is also a REST API and Docker image for building it into something else.

About 21,700 stars, Apache-2.0, at v1.3.1 when scanned. The limits: the README is mostly in Chinese with English, Japanese and Korean translations, code changes have been rare since mid-2025, and you still need to check the output against your country's photo rules.

Who it is for

Anyone who needs passport, visa or ID photos and would rather not upload a face photo to a website, and developers adding ID photo generation to an app.

Getting started

1. Get the code and install the requirements

git clone https://github.com/Zeyi-Lin/HivisionIDPhotos.git && cd HivisionIDPhotos && pip install -r requirements.txt -r requirements-app.txt

2. Download the matting models

python scripts/download_model.py --models all

3. Start the local web interface

python app.py

Python 3.10 in a virtual environment is what the project tests on. The default MODNet plus MTCNN combination runs on any CPU; the more accurate birefnet-v1-lite model wants about 6 GB of memory, or a GPU.

Safety scan

We cloned Zeyi-Lin/HivisionIDPhotos at commit 5c191e2 on Oct 26, 2026 and ran the checks described on the GitHub Tools page: credential patterns, decode-and-execute code, install-time scripts, committed binaries, risky CI workflows, every host the code talks to, known vulnerabilities in pinned dependencies, and project hygiene. A person read every hit. This is what we found.

  • No secrets, no suspicious code patterns, no committed binaries and no bare-IP URLs in about 10,000 lines.
  • The one installer script, .devcontainer/start.sh, uses sudo and edits a shell profile, but only inside the development container; it is not part of a normal install.
  • The only external API in the code is api-cn.faceplusplus.com, for the optional Face++ online face detector. The default detectors, MTCNN and RetinaFace, run locally. Model weights download from the project's GitHub releases and Hugging Face.
  • No lockfile, so the scanner did not look up known advisories for the Python dependencies.
  • One workflow, none using pull_request_target; its 4 third-party actions are not pinned to a commit. Licence present; no security policy, contributing guide or Dependabot.

What the scanner counted

CheckResult
SecretsNone found.
Suspicious codeNone found.
Install-time code1 installer script (one edits your shell profile; one can call sudo)
Committed binariesNone.
CI workflows1 workflow. None use pull_request_target. 4 of 4 third-party actions pinned to a tag rather than a commit.
Network hosts5 distinct hosts referenced from source; most often github.com, www.apache.org, api-cn.faceplusplus.com, gist.github.com. No URLs to bare IP addresses.
Known vulnerabilitiesNo lockfile to check: dependencies are declared as ranges, so what gets installed is whatever is current on the day.
Project hygieneHas licence file. Missing security policy, automated dependency updates, CodeQL, contributing guide.
OpenSSF ScorecardNot scored: the project is not in Scorecard's weekly index.

The raw findings

Every hit the scanner wrote out, with a link to the exact line at the scanned commit. Secrets candidates are redacted.

Installer scripts (1)

By the numbers

Stars21.7K
Forks2,523
Contributors24
Commits446
Open issues100
Open pull requests6
Releases17
Latest releasev1.3.1
LicenceApache-2.0
Main languagePython
Project age3 years
Last pushJul 3, 2026
Tracked files90
Lines of code10.1K
Checkout size15 MB

Lines by language: Python 6,844, Markdown 3,066, JSON 148, YAML 68, Shell 11.

Questions

Is HivisionIDPhotos free?

Yes. It is open source under Apache-2.0 and free to use, including commercially. The optional rmbg-1.4 and Face++ components have their own terms.

Does HivisionIDPhotos upload my photo?

No, not with the defaults. Matting and face detection run on your computer. Only if you choose the Face++ detector and enter its API key does an image go to that service.

Which ID photo sizes does it support?

It ships with common presets such as one-inch, two-inch and US passport sizes, and accepts custom sizes in pixels or millimetres, plus custom background colours by hex code. Always check the rules of the office you are submitting to.


This post is part of GitHub Tools, where every repository is cloned and scanned before it is written up. The scan is a snapshot of one commit on one day; the repository has moved on since, so check it before you install.