{"id":14437971,"url":"https://github.com/Zeyi-Lin/HivisionIDPhotos","last_synced_at":"2025-08-26T22:31:50.325Z","repository":{"id":178426855,"uuid":"655413331","full_name":"Zeyi-Lin/HivisionIDPhotos","owner":"Zeyi-Lin","description":"⚡️HivisionIDPhotos: a lightweight and efficient AI ID photos tools. 一个轻量级的AI证件照制作算法。","archived":false,"fork":false,"pushed_at":"2025-07-12T05:34:27.000Z","size":48948,"stargazers_count":18368,"open_issues_count":81,"forks_count":1992,"subscribers_count":79,"default_branch":"master","last_synced_at":"2025-07-12T07:07:15.266Z","etag":null,"topics":["cnn","demo","docker","face-recognition","fastapi","gradio","idphoto","machine-learning","matting","mtcnn","tools","unet"],"latest_commit_sha":null,"homepage":"https://modelscope.cn/studios/SwanLab/HivisionIDPhotos","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zeyi-Lin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-06-18T20:17:56.000Z","updated_at":"2025-07-12T05:34:31.000Z","dependencies_parsed_at":"2024-12-23T21:01:22.224Z","dependency_job_id":"98041da7-08b4-44e7-83d7-1bebadb21c57","html_url":"https://github.com/Zeyi-Lin/HivisionIDPhotos","commit_stats":{"total_commits":404,"total_committers":22,"mean_commits":"18.363636363636363","dds":"0.10643564356435642","last_synced_commit":"75110dedd85f380ff743ca5eeb0f0f029084608b"},"previous_names":["xiaolin199912/hivisionidphotos","zeyi-lin/hivisionidphotos"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/Zeyi-Lin/HivisionIDPhotos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zeyi-Lin%2FHivisionIDPhotos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zeyi-Lin%2FHivisionIDPhotos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zeyi-Lin%2FHivisionIDPhotos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zeyi-Lin%2FHivisionIDPhotos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zeyi-Lin","download_url":"https://codeload.github.com/Zeyi-Lin/HivisionIDPhotos/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zeyi-Lin%2FHivisionIDPhotos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272262322,"owners_count":24902626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn","demo","docker","face-recognition","fastapi","gradio","idphoto","machine-learning","matting","mtcnn","tools","unet"],"created_at":"2024-08-31T10:00:43.081Z","updated_at":"2025-08-26T22:31:50.313Z","avatar_url":"https://github.com/Zeyi-Lin.png","language":"Python","funding_links":[],"categories":["置顶","Python","Repos","精选文章","\u003cspan id=\"image\"\u003eImage\u003c/span\u003e","AI应用","Image Generation \u0026 Editing","B站"],"sub_categories":["04、多媒体处理中心","AI图像创作","\u003cspan id=\"tool\"\u003eLLM (LLM \u0026 Tool)\u003c/span\u003e"],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg alt=\"hivision_logo\" src=\"assets/hivision_logo.png\" width=120 height=120\u003e\n\u003ch1\u003eHivisionIDPhoto\u003c/h1\u003e\n\n[English](README_EN.md) / 中文 / [日本語](README_JP.md) / [한국어](README_KO.md)\n\n[![][release-shield]][release-link]\n[![][dockerhub-shield]][dockerhub-link]\n[![][github-stars-shield]][github-stars-link]\n[![][github-issues-shield]][github-issues-link]\n[![][github-contributors-shield]][github-contributors-link]\n[![][github-forks-shield]][github-forks-link]\n[![][license-shield]][license-link]  \n[![][wechat-shield]][wechat-link]\n[![][spaces-shield]][spaces-link]\n[![][swanhub-demo-shield]][swanhub-demo-link]\n[![][modelscope-shield]][modelscope-link]\n[![][modelers-shield]][modelers-link]\n[![][compshare-shield]][compshare-link]\n\n[![][trendshift-shield]][trendshift-link]\n[![][hellogithub-shield]][hellogithub-link]\n\n\u003cimg src=\"assets/demoImage.jpg\" width=900\u003e\n\n\u003c/div\u003e\n\n\u003e **相关项目**：\n\u003e\n\u003e - [SwanLab](https://github.com/SwanHubX/SwanLab)：一个开源、现代化设计的深度学习训练跟踪与可视化工具，同时支持云端/离线使用，国内好用的Wandb平替；适配30+主流框架（PyTorch、HuggingFace Transformers、LLaMA Factory、Lightning等），欢迎使用！\n\n\n\u003cbr\u003e\n\n# 目录\n\n- [最近更新](#-最近更新)\n- [项目简介](#-项目简介)\n- [社区](#-社区)\n- [准备工作](#-准备工作)\n- [Demo启动](#-运行-gradio-demo)\n- [Python推理](#-python-推理)\n- [API服务部署](#️-部署-api-服务)\n- [Docker部署](#-docker-部署)\n- [联系我们](#-联系我们)\n- [FAQ](#faq)\n- [感谢支持](#-感谢支持)\n- [License](#-lincese)\n- [引用](#-引用)\n\n\u003cbr\u003e\n\n# 🤩 最近更新\n\n- 在线体验： [![Spaces](https://img.shields.io/badge/🤗-Open%20in%20Spaces-blue)](https://huggingface.co/spaces/TheEeeeLin/HivisionIDPhotos)、[![][modelscope-shield]][modelscope-link]、[![][modelers-shield]][modelers-link]、[![][compshare-shield]][compshare-link]\n\n- 2024.11.20: Gradio Demo增加**打印排版**选项卡，支持六寸、五寸、A4、3R、4R五种排版尺寸\n- 2024.11.16: API接口增加美颜参数\n- 2024.09.25: 增加**五寸相纸**和**JPEG下载**选项｜默认照片下载支持300DPI\n- 2024.09.24: API接口增加base64图像传入选项 | Gradio Demo增加**排版照裁剪线**功能\n- 2024.09.22: Gradio Demo增加**野兽模式**，可设置内存加载策略 | API接口增加**dpi、face_alignment**参数\n- 2024.09.18: Gradio Demo增加**分享模版照**功能、增加**美式证件照**背景选项\n- 2024.09.17: Gradio Demo增加**自定义底色-HEX输入**功能 | **（社区贡献）C++版本** - [HivisionIDPhotos-cpp](https://github.com/zjkhahah/HivisionIDPhotos-cpp) 贡献 by [zjkhahah](https://github.com/zjkhahah)\n- 2024.09.16: Gradio Demo增加**人脸旋转对齐**功能，自定义尺寸输入支持**毫米**单位\n\n\u003cbr\u003e\n\n# 项目简介\n\n\u003e 🚀 谢谢你对我们的工作感兴趣。您可能还想查看我们在图像领域的其他成果，欢迎来信:zeyi.lin@swanhub.co.\n\nHivisionIDPhoto 旨在开发一种实用、系统性的证件照智能制作算法。\n\n它利用一套完善的AI模型工作流程，实现对多种用户拍照场景的识别、抠图与证件照生成。\n\n**HivisionIDPhoto 可以做到：**\n\n1. 轻量级抠图（纯离线，仅需 **CPU** 即可快速推理）\n2. 根据不同尺寸规格生成不同的标准证件照、六寸排版照\n3. 支持 纯离线 或 端云 推理\n4. 美颜\n5. 智能换正装（waiting）\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"assets/demo.png\" width=900\u003e\n\u003c/div\u003e\n\n---\n\n如果 HivisionIDPhoto 对你有帮助，请 star 这个 repo 或推荐给你的朋友，解决证件照应急制作问题！\n\n\u003cbr\u003e\n\n# 🏠 社区\n\n我们分享了一些由社区构建的HivisionIDPhotos的有趣应用和扩展：\n\n| [HivisionIDPhotos-ComfyUI][community-hivision-comfyui] | [HivisionIDPhotos-wechat-weapp][community-hivision-wechat] |\n| :----------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------: |\n| \u003ca href=\"https://github.com/AIFSH/HivisionIDPhotos-ComfyUI\"\u003e \u003cimg src=\"assets/comfyui.png\" width=\"900\" alt=\"ComfyUI workflow\"\u003e \u003c/a\u003e  | \u003ca href=\"https://github.com/no1xuan/HivisionIDPhotos-wechat-weapp\"\u003e \u003cimg src=\"assets/community-wechat-miniprogram.png\" width=\"900\" alt=\"ComfyUI workflow\"\u003e \u003c/a\u003e  |\n|ComfyUI证件照处理工作流 | 证件照微信小程序（JAVA后端+原生前端） |\n\n| [HivisionIDPhotos-Uniapp][community-hivision-uniapp] | [HivisionIDPhotos-web](https://github.com/jkm199/HivisionIDPhotos-web)|\n| :------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------: |\n| \u003ca href=\"https://github.com/soulerror/HivisionIDPhotos-Uniapp\"\u003e \u003cimg src=\"assets/community-uniapp-wechat-miniprogram.png\" width=\"900\" alt=\"HivisionIDPhotos-uniapp\"\u003e \u003c/a\u003e  | \u003ca href=\"https://github.com/jkm199/HivisionIDPhotos-web\"\u003e \u003cimg src=\"assets/community-web.png\" width=\"900\" alt=\"HivisionIDPhotos-uniapp\"\u003e \u003c/a\u003e  |\n| 证件照微信小程序（uniapp）| 证件照应用网页版 |\n\n\n- [HivisionIDPhotos-cpp](https://github.com/zjkhahah/HivisionIDPhotos-cpp): HivisionIDphotos C++版本，由 [zjkhahah](https://github.com/zjkhahah) 构建\n- [ai-idphoto](https://github.com/wmlcjj/ai-idphoto): [HivisionIDPhotos-wechat-weapp](https://github.com/no1xuan/HivisionIDPhotos-wechat-weapp) 的uniapp多端兼容版，由 [wmlcjj](https://github.com/wmlcjj) 贡献\n- [HivisionIDPhotos-uniapp-WeChat-gpto1](https://github.com/jkm199/HivisionIDPhotos-uniapp-WeChat-gpto1/): 由gpt-o1辅助完成开发的证件照微信小程序，由 [jkm199](https://github.com/jkm199) 贡献\n- [HivisionIDPhotos-windows-GUI](https://github.com/zhaoyun0071/HivisionIDPhotos-windows-GUI)：Windows客户端应用，由 [zhaoyun0071](https://github.com/zhaoyun0071) 构建\n- [HivisionIDPhotos-NAS](https://github.com/ONG-Leo/HivisionIDPhotos-NAS): 群晖NAS部署中文教程，由 [ONG-Leo](https://github.com/ONG-Leo) 贡献\n\n\n\u003cbr\u003e\n\n# 🔧 准备工作\n\n环境安装与依赖：\n- Python \u003e= 3.7（项目主要测试在 python 3.10）\n- OS: Linux, Windows, MacOS\n\n## 1. 克隆项目\n\n```bash\ngit clone https://github.com/Zeyi-Lin/HivisionIDPhotos.git\ncd  HivisionIDPhotos\n```\n\n## 2. 安装依赖环境\n\n\u003e 建议 conda 创建一个 python3.10 虚拟环境后，执行以下命令\n\n```bash\npip install -r requirements.txt\npip install -r requirements-app.txt\n```\n\n## 3. 下载人像抠图模型权重文件\n\n**方式一：脚本下载**\n\n```bash\npython scripts/download_model.py --models all\n# 如需指定下载某个模型\n# python scripts/download_model.py --models modnet_photographic_portrait_matting\n```\n\n**方式二：直接下载**\n\n模型均存到项目的`hivision/creator/weights`目录下：\n\n| 人像抠图模型 | 介绍 | 下载 |\n| -- | -- | -- |\n| MODNet | [MODNet](https://github.com/ZHKKKe/MODNet)官方权重 | [下载](https://github.com/Zeyi-Lin/HivisionIDPhotos/releases/download/pretrained-model/modnet_photographic_portrait_matting.onnx)(24.7MB)|\n| hivision_modnet | 对纯色换底适配性更好的抠图模型 | [下载](https://github.com/Zeyi-Lin/HivisionIDPhotos/releases/download/pretrained-model/hivision_modnet.onnx)(24.7MB) |\n| rmbg-1.4 | [BRIA AI](https://huggingface.co/briaai/RMBG-1.4) 开源的抠图模型 | [下载](https://huggingface.co/briaai/RMBG-1.4/resolve/main/onnx/model.onnx?download=true)(176.2MB)后重命名为`rmbg-1.4.onnx` |\n| birefnet-v1-lite | [ZhengPeng7](https://github.com/ZhengPeng7/BiRefNet) 开源的抠图模型，拥有最好的分割精度 | [下载](https://github.com/ZhengPeng7/BiRefNet/releases/download/v1/BiRefNet-general-bb_swin_v1_tiny-epoch_232.onnx)(224MB)后重命名为`birefnet-v1-lite.onnx` |\n\n\u003e 如果下载网速不顺利：前往[SwanHub](https://swanhub.co/ZeYiLin/HivisionIDPhotos_models/tree/main)下载。\n\n\n## 4. 人脸检测模型配置（可选）\n\n| 拓展人脸检测模型 | 介绍 | 使用文档 |\n| -- | -- | -- |\n| MTCNN | **离线**人脸检测模型，高性能CPU推理（毫秒级），为默认模型，检测精度较低 | Clone此项目后直接使用 |\n| RetinaFace | **离线**人脸检测模型，CPU推理速度中等（秒级），精度较高| [下载](https://github.com/Zeyi-Lin/HivisionIDPhotos/releases/download/pretrained-model/retinaface-resnet50.onnx)后放到`hivision/creator/retinaface/weights`目录下 |\n| Face++ | 旷视推出的在线人脸检测API，检测精度较高，[官方文档](https://console.faceplusplus.com.cn/documents/4888373) | [使用文档](docs/face++_CN.md)|\n\n## 5. 性能参考\n\n\u003e 测试环境为Mac M1 Max 64GB，非GPU加速，测试图片分辨率为 512x715(1) 与 764×1146(2)。\n\n| 模型组合 | 内存占用 | 推理时长(1) | 推理时长(2) |\n| -- | -- | -- | -- |\n| MODNet + mtcnn | 410MB | 0.207s | 0.246s |\n| MODNet + retinaface | 405MB | 0.571s | 0.971s |\n| birefnet-v1-lite + retinaface | 6.20GB | 7.063s | 7.128s |\n\n## 6. GPU推理加速（可选）\n\n在当前版本，可被英伟达GPU加速的模型为`birefnet-v1-lite`，并请确保你有16GB左右的显存。\n\n如需使用英伟达GPU加速推理，在确保你已经安装[CUDA](https://developer.nvidia.com/cuda-downloads)与[cuDNN](https://developer.nvidia.com/cudnn)后，根据[onnxruntime-gpu文档](https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html#cuda-12x)找到对应的`onnxruntime-gpu`版本安装，以及根据[pytorch官网](https://pytorch.org/get-started/locally/)找到对应的`torch`版本安装。\n\n```bash\n# 假如你的电脑安装的是CUDA 12.x, cuDNN 8\n# 安装torch是可选的，如果你始终配置不好cuDNN，那么试试安装torch\npip install onnxruntime-gpu==1.18.0\npip install torch --index-url https://download.pytorch.org/whl/cu121\n```\n\n完成安装后，调用`birefnet-v1-lite`模型即可利用GPU加速推理。\n\n\u003e TIPS: CUDA 支持向下兼容。比如你的 CUDA 版本为 12.6，`torch` 官方目前支持的最高版本为 12.4（\u003c12.6），`torch`仍可以正常使用CUDA。\n\n\u003cbr\u003e\n\n# ⚡️ 运行 Gradio Demo\n\n```bash\npython app.py\n```\n\n运行程序将生成一个本地 Web 页面，在页面中可完成证件照的操作与交互。\n\n\u003cimg src=\"assets/harry.png\" width=900\u003e\n\n\u003cbr\u003e\n\n# 🚀 Python 推理\n\n核心参数：\n\n- `-i`: 输入图像路径\n- `-o`: 保存图像路径\n- `-t`: 推理类型，有idphoto、human_matting、add_background、generate_layout_photos可选\n- `--matting_model`: 人像抠图模型权重选择\n- `--face_detect_model`: 人脸检测模型选择\n\n更多参数可通过`python inference.py --help`查看\n\n## 1. 证件照制作\n\n输入 1 张照片，获得 1 张标准证件照和 1 张高清证件照的 4 通道透明 png\n\n```python\npython inference.py -i demo/images/test0.jpg -o ./idphoto.png --height 413 --width 295\n```\n\n## 2. 人像抠图\n\n输入 1 张照片，获得 1张 4 通道透明 png\n\n```python\npython inference.py -t human_matting -i demo/images/test0.jpg -o ./idphoto_matting.png --matting_model hivision_modnet\n```\n\n## 3. 透明图增加底色\n\n输入 1 张 4 通道透明 png，获得 1 张增加了底色的 3通道图像\n\n```python\npython inference.py -t add_background -i ./idphoto.png -o ./idphoto_ab.jpg  -c 4f83ce -k 30 -r 1\n```\n\n## 4. 得到六寸排版照\n\n输入 1 张 3 通道照片，获得 1 张六寸排版照\n\n```python\npython inference.py -t generate_layout_photos -i ./idphoto_ab.jpg -o ./idphoto_layout.jpg  --height 413 --width 295 -k 200\n```\n\n## 5. 证件照裁剪\n\n输入 1 张 4 通道照片（抠图好的图像），获得 1 张标准证件照和 1 张高清证件照的 4 通道透明 png\n\n```python\npython inference.py -t idphoto_crop -i ./idphoto_matting.png -o ./idphoto_crop.png --height 413 --width 295\n```\n\n\n\u003cbr\u003e\n\n# ⚡️ 部署 API 服务\n\n## 启动后端\n\n```\npython deploy_api.py\n```\n\n## 请求 API 服务\n\n详细请求方式请参考 [API 文档](docs/api_CN.md)，包含以下请求示例：\n- [cURL](docs/api_CN.md#curl-请求示例)\n- [Python](docs/api_CN.md#python-请求示例)\n\n\u003cbr\u003e\n\n# 🐳 Docker 部署\n\n## 1. 拉取或构建镜像\n\n\u003e 以下方式三选一\n\n**方式一：拉取最新镜像：**\n\n```bash\ndocker pull linzeyi/hivision_idphotos\n```\n\n**方式二：Dockrfile 直接构建镜像：**\n\n在确保将至少一个[抠图模型权重文件](#3-下载权重文件)放到`hivision/creator/weights`下后，在项目根目录执行：\n\n```bash\ndocker build -t linzeyi/hivision_idphotos .\n```\n\n**方式三：Docker compose 构建：**\n\n在确保将至少一个[抠图模型权重文件](#3-下载权重文件)放到`hivision/creator/weights`下后，在项目根目录下执行：\n\n```bash\ndocker compose build\n```\n\n## 2. 运行服务\n\n**启动 Gradio Demo 服务**\n\n运行下面的命令，在你的本地访问 [http://127.0.0.1:7860](http://127.0.0.1:7860/) 即可使用。\n\n```bash\ndocker run -d -p 7860:7860 linzeyi/hivision_idphotos\n```\n\n**启动 API 后端服务**\n\n```bash\ndocker run -d -p 8080:8080 linzeyi/hivision_idphotos python3 deploy_api.py\n```\n\n**两个服务同时启动**\n\n```bash\ndocker compose up -d\n```\n\n## 环境变量\n\n本项目提供了一些额外的配置项，使用环境变量进行设置：\n\n| 环境变量 | 类型\t| 描述 | 示例 |\n|--|--|--|--|\n| FACE_PLUS_API_KEY\t | 可选\t| 这是你在 Face++ 控制台申请的 API 密钥\t | `7-fZStDJ····` |\n| FACE_PLUS_API_SECRET\t | 可选\t| Face++ API密钥对应的Secret | `VTee824E····` |\n| RUN_MODE | 可选 | 运行模式，可选值为`beast`(野兽模式)。野兽模式下人脸检测和抠图模型将不释放内存，从而获得更快的二次推理速度。建议内存16GB以上尝试。 | `beast` |\n| DEFAULT_LANG | 可选 | Gradio Demo启动时的默认语言| `en` |\n\ndocker使用环境变量示例：\n```bash\ndocker run  -d -p 7860:7860 \\\n    -e FACE_PLUS_API_KEY=7-fZStDJ···· \\\n    -e FACE_PLUS_API_SECRET=VTee824E···· \\\n    -e RUN_MODE=beast \\\n    -e DEFAULT_LANG=en \\\n    linzeyi/hivision_idphotos  \n```\n\n\u003cbr\u003e\n\n# FAQ\n\n## 1. 如何修改预设尺寸和颜色？\n\n- 尺寸：修改[size_list_CN.csv](demo/assets/size_list_CN.csv)后再次运行 `app.py` 即可，其中第一列为尺寸名，第二列为高度，第三列为宽度。\n- 颜色：修改[color_list_CN.csv](demo/assets/color_list_CN.csv)后再次运行 `app.py` 即可，其中第一列为颜色名，第二列为Hex值。\n\n## 2. 如何修改水印字体？\n\n1. 将字体文件放到`hivision/plugin/font`文件夹下\n2. 修改`hivision/plugin/watermark.py`的`font_file`参数值为字体文件名\n\n## 3. 如何添加社交媒体模板照？\n\n1. 将模板图片放到`hivision/plugin/template/assets`文件夹下。模板图片是一个4通道的透明png。\n2. 在`hivision/plugin/template/assets/template_config.json`文件中添加最新的模板信息，其中`width`为模板图宽度(px)，`height`为模板图高度(px)，`anchor_points`为模板中透明区域的四个角的坐标(px)；`rotation`为透明区域相对于垂直方向的旋转角度，\u003e0为逆时针，\u003c0为顺时针。\n3. 在`demo/processor.py`的`_generate_image_template`函数中的`TEMPLATE_NAME_LIST`变量添加最新的模板名\n\n\u003cimg src=\"assets/social_template.png\" width=\"500\"\u003e\n\n## 4. 如何修改Gradio Demo的顶部导航栏？\n\n- 修改`demo/assets/title.md`\n\n## 5. 如何添加/修改「打印排版」中的尺寸？\n\n- 修改`demo/locales.py`中的`print_switch`字典，添加/修改新的尺寸名称和尺寸参数，然后重新运行`python app.py`\n\n\u003cbr\u003e\n\n# 📧 联系我们\n\n如果您有任何问题，请发邮件至 zeyi.lin@swanhub.co\n\n\u003cbr\u003e\n\n# 🙏 感谢支持\n\n[![Stargazers repo roster for @Zeyi-Lin/HivisionIDPhotos](https://reporoster.com/stars/Zeyi-Lin/HivisionIDPhotos)](https://github.com/Zeyi-Lin/HivisionIDPhotos/stargazers)\n\n[![Forkers repo roster for @Zeyi-Lin/HivisionIDPhotos](https://reporoster.com/forks/Zeyi-Lin/HivisionIDPhotos)](https://github.com/Zeyi-Lin/HivisionIDPhotos/network/members)\n\n[![Star History Chart](https://api.star-history.com/svg?repos=Zeyi-Lin/HivisionIDPhotos\u0026type=Date)](https://star-history.com/#Zeyi-Lin/HivisionIDPhotos\u0026Date)\n\n贡献者们：\n\n\u003ca href=\"https://github.com/Zeyi-Lin/HivisionIDPhotos/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=Zeyi-Lin/HivisionIDPhotos\" /\u003e\n\u003c/a\u003e\n\n[Zeyi-Lin](https://github.com/Zeyi-Lin)、[SAKURA-CAT](https://github.com/SAKURA-CAT)、[Feudalman](https://github.com/Feudalman)、[swpfY](https://github.com/swpfY)、[Kaikaikaifang](https://github.com/Kaikaikaifang)、[ShaohonChen](https://github.com/ShaohonChen)、[KashiwaByte](https://github.com/KashiwaByte)\n\n\u003cbr\u003e\n\n# 📜 Lincese\n\nThis repository is licensed under the [Apache-2.0 License](LICENSE).\n\n\u003cbr\u003e\n\n# 📚 引用\n\n如果您在研究或项目中使用了HivisionIDPhotos，请考虑引用我们的工作。您可以使用以下BibTeX条目：\n\n```bibtex\n@misc{hivisionidphotos,\n      title={{HivisionIDPhotos: A Lightweight and Efficient AI ID Photos Tool}},\n      author={Zeyi Lin and SwanLab Team},\n      year={2024},\n      publisher={GitHub},\n      url = {\\url{https://github.com/Zeyi-Lin/HivisionIDPhotos}},\n}\n```\n\n\n\n\n[github-stars-shield]: https://img.shields.io/github/stars/zeyi-lin/hivisionidphotos?color=ffcb47\u0026labelColor=black\u0026style=flat-square\n[github-stars-link]: https://github.com/zeyi-lin/hivisionidphotos/stargazers\n\n[swanhub-demo-shield]: https://swanhub.co/git/repo/SwanHub%2FAuto-README/file/preview?ref=main\u0026path=swanhub.svg\n[swanhub-demo-link]: https://swanhub.co/ZeYiLin/HivisionIDPhotos/demo\n\n[spaces-shield]: https://img.shields.io/badge/🤗-Open%20in%20Spaces-blue\n[spaces-link]: https://huggingface.co/spaces/TheEeeeLin/HivisionIDPhotos\n\n\u003c!-- 微信群链接 --\u003e\n[wechat-shield]: https://img.shields.io/badge/WeChat-微信-4cb55e\n[wechat-link]: https://docs.qq.com/doc/DUkpBdk90eWZFS2JW\n\n\u003c!-- Github Release --\u003e\n[release-shield]: https://img.shields.io/github/v/release/zeyi-lin/hivisionidphotos?color=369eff\u0026labelColor=black\u0026logo=github\u0026style=flat-square\n[release-link]: https://github.com/zeyi-lin/hivisionidphotos/releases\n\n[license-shield]: https://img.shields.io/badge/license-apache%202.0-white?labelColor=black\u0026style=flat-square\n[license-link]: https://github.com/Zeyi-Lin/HivisionIDPhotos/blob/master/LICENSE\n\n[github-issues-shield]: https://img.shields.io/github/issues/zeyi-lin/hivisionidphotos?color=ff80eb\u0026labelColor=black\u0026style=flat-square\n[github-issues-link]: https://github.com/zeyi-lin/hivisionidphotos/issues\n\n[dockerhub-shield]: https://img.shields.io/docker/v/linzeyi/hivision_idphotos?color=369eff\u0026label=docker\u0026labelColor=black\u0026logoColor=white\u0026style=flat-square\n[dockerhub-link]: https://hub.docker.com/r/linzeyi/hivision_idphotos/tags\n\n[trendshift-shield]: https://trendshift.io/api/badge/repositories/11622\n[trendshift-link]: https://trendshift.io/repositories/11622\n\n[hellogithub-shield]: https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=8ea1457289fb4062ba661e5299e733d6\u0026claim_uid=Oh5UaGjfrblg0yZ\n[hellogithub-link]: https://hellogithub.com/repository/8ea1457289fb4062ba661e5299e733d6\n\n[github-contributors-shield]: https://img.shields.io/github/contributors/zeyi-lin/hivisionidphotos?color=c4f042\u0026labelColor=black\u0026style=flat-square\n[github-contributors-link]: https://github.com/zeyi-lin/hivisionidphotos/graphs/contributors\n\n[github-forks-shield]: https://img.shields.io/github/forks/zeyi-lin/hivisionidphotos?color=8ae8ff\u0026labelColor=black\u0026style=flat-square\n[github-forks-link]: https://github.com/zeyi-lin/hivisionidphotos/network/members\n\n[modelscope-shield]: https://img.shields.io/badge/Demo_on_ModelScope-purple?logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjIzIiBoZWlnaHQ9IjIwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KCiA8Zz4KICA8dGl0bGU+TGF5ZXIgMTwvdGl0bGU+CiAgPHBhdGggaWQ9InN2Z18xNCIgZmlsbD0iIzYyNGFmZiIgZD0ibTAsODkuODRsMjUuNjUsMGwwLDI1LjY0OTk5bC0yNS42NSwwbDAsLTI1LjY0OTk5eiIvPgogIDxwYXRoIGlkPSJzdmdfMTUiIGZpbGw9IiM2MjRhZmYiIGQ9Im05OS4xNCwxMTUuNDlsMjUuNjUsMGwwLDI1LjY1bC0yNS42NSwwbDAsLTI1LjY1eiIvPgogIDxwYXRoIGlkPSJzdmdfMTYiIGZpbGw9IiM2MjRhZmYiIGQ9Im0xNzYuMDksMTQxLjE0bC0yNS42NDk5OSwwbDAsMjIuMTlsNDcuODQsMGwwLC00Ny44NGwtMjIuMTksMGwwLDI1LjY1eiIvPgogIDxwYXRoIGlkPSJzdmdfMTciIGZpbGw9IiMzNmNmZDEiIGQ9Im0xMjQuNzksODkuODRsMjUuNjUsMGwwLDI1LjY0OTk5bC0yNS42NSwwbDAsLTI1LjY0OTk5eiIvPgogIDxwYXRoIGlkPSJzdmdfMTgiIGZpbGw9IiMzNmNmZDEiIGQ9Im0wLDY0LjE5bDI1LjY1LDBs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cuNzk0VjE1Ljc3ODhaIiBmaWxsPSIjREUwNDI5Ii8+CjxwYXRoIGQ9Ik0yNC42NzQ4IDMxLjU1NzZIOC40OTQxNFY0Ny4zMzYzSDI0LjY3NDhWMzEuNTU3NloiIGZpbGw9IiNERTA0MjkiLz4KPHBhdGggZD0iTTYwLjg3OTkgMzEuNTU3Nkg0NC42OTkyVjQ3LjMzNjNINjAuODc5OVYzMS41NTc2WiIgZmlsbD0iI0RFMDQyOSIvPgo8cGF0aCBkPSJNNzkuNjIwMSAzMS41NTc2SDYzLjQzOTVWNDcuMzM2M0g3OS42MjAxVjMxLjU1NzZaIiBmaWxsPSIjREUwNDI5Ii8+CjxwYXRoIGQ9Ik0xMTUuODI1IDMxLjU1NzZIOTkuNjQ0NVY0Ny4zMzYzSDExNS44MjVWMzEuNTU3NloiIGZpbGw9IiNERTA0MjkiLz4KPHBhdGggZD0iTTcwLjI1NDkgNDcuMzM1OUg1NC4wNzQyVjYzLjExNDdINzAuMjU0OVY0Ny4zMzU5WiIgZmlsbD0iI0RFMDQyOSIvPgo8L3N2Zz4=\u0026labelColor=white\n[modelers-link]: https://modelers.cn/spaces/SwanLab/HivisionIDPhotos\n\n[compshare-shield]: https://www-s.ucloud.cn/2025/02/dbef8b07ea3d316006d9c22765c3cd53_1740104342584.svg\n[compshare-link]: https://www.compshare.cn/images-detail?ImageID=compshareImage-17jacgm4ju16\u0026ytag=HG_GPU_HivisionIDPhotos\n\n\u003c!-- 社区项目链接 --\u003e\n[community-hivision-comfyui]: https://github.com/AIFSH/HivisionIDPhotos-ComfyUI\n[community-hivision-wechat]: https://github.com/no1xuan/HivisionIDPhotos-wechat-weapp\n[community-hivision-uniapp]: https://github.com/soulerror/HivisionIDPhotos-Uniapp\n[community-hivision-cpp]: https://github.com/zjkhahah/HivisionIDPhotos-cpp\n[community-hivision-windows-gui]: https://github.com/zhaoyun0071/HivisionIDPhotos-windows-GUI\n[community-hivision-nas]: https://github.com/ONG-Leo/HivisionIDPhotos-NAS","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZeyi-Lin%2FHivisionIDPhotos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FZeyi-Lin%2FHivisionIDPhotos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZeyi-Lin%2FHivisionIDPhotos/lists"}