Giter Site home page Giter Site logo

xiaolin199912 / hivisionidphotos Goto Github PK

View Code? Open in Web Editor NEW
124.0 2.0 41.0 28.11 MB

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

Home Page: https://swanhub.co/ZeYiLin/HivisionIDPhotos/demo

Python 99.73% Dockerfile 0.27%
demo gradio idphoto machine-learning matting tools cnn docker face-recognition fastapi mtcnn unet

hivisionidphotos's Introduction

HivisionIDPhoto

English / 中文

GitHub SwanHub Demo zhihu

🤩项目更新

  • 在线体验: SwanHub Demo
  • 2023.12.1: 更新API部署(基于fastapi)
  • 2023.6.20: 更新预设尺寸菜单
  • 2023.6.19: 更新排版照
  • 2023.6.13: 更新中心渐变色
  • 2023.6.11: 更新上下渐变色
  • 2023.6.8: 更新自定义尺寸
  • 2023.6.4: 更新自定义底色、人脸检测Bug通知
  • 2023.5.10: 更新不改尺寸只换底

Overview

🚀谢谢你对我们的工作感兴趣。您可能还想查看我们在图像领域的其他成果,欢迎来信:[email protected].

HivisionIDPhoto旨在开发一种实用的证件照智能制作算法。

它利用一套完善的模型工作流程,实现对多种用户拍照场景的识别、抠图与证件照生成。

HivisionIDPhoto可以做到:

  1. 轻量级抠图
  2. 根据不同尺寸规格生成不同的标准证件照、六寸排版照
  3. 美颜(waiting)
  4. 智能换正装(waiting)

如果HivisionIDPhoto对你有帮助,请star这个repo或推荐给你的朋友,解决证件照应急制作问题!

🔧环境安装与依赖

  • Python >= 3.7 (Recommend to use Anaconda or Miniconda)
  • onnxruntime
  • OpenCV
  • Option: Linux, Windows, MacOS

Installation

  1. Clone repo
git lfs install && git clone https://swanhub.co/ZeYiLin/HivisionIDPhotos.git
cd  HivisionIDPhotos
  1. Install dependent packages
pip install -r requirements.txt

⚡️快速推理

模型与代码通过git-lfs下载。

git lfs install
git clone https://swanhub.co/ZeYiLin/HivisionIDPhotos.git

Demo

python app.py

运行程序将生成一个本地Web页面,在页面中可完成证件照的操作与交互。

部署API服务

python deploy_api.py

请求API服务(Python)

用Python给服务发送请求:

证件照制作(输入1张照片,获得1张标准证件照和1张高清证件照的4通道透明png):

python requests_api.py -u http://127.0.0.1:8080 -i test.jpg -o ./idphoto.png -s '(413,295)'

增加底色(输入1张4通道透明png,获得1张增加了底色的图像):

python requests_api.py -u http://127.0.0.1:8080 -t add_background -i ./idphoto.png -o ./idhoto_ab.jpg  -c '(0,0,0)'

得到六寸排版照(输入1张3通道照片,获得1张六寸排版照):

python requests_api.py -u http://127.0.0.1:8080 -t generate_layout_photos -i ./idhoto_ab.jpg -o ./idhoto_layout.jpg  -s '(413,295)'

🐳Docker部署

在根目录下执行:

docker build -t hivision_idphotos .

等待镜像封装完毕后,运行以下指令,即可开启API服务:

docker run -p 8080:8080 hivision_idphotos

引用项目

  1. MTCNN: https://github.com/ipazc/mtcnn
  2. ModNet: https://github.com/ZHKKKe/MODNet

📧联系我们

如果您有任何问题,请发邮件至 [email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.