Skip to content

Commit

Permalink
feat: improve README
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeyi-Lin committed Sep 1, 2024
1 parent adb695d commit 29373b6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pip install -r requirements.txt

**3. 下载权重文件**

在我们的[Release](https://github.com/Zeyi-Lin/HivisionIDPhotos/releases)下载权重文件`hivision_modnet_V1.0`,存到根目录下。
在我们的[Release](https://github.com/Zeyi-Lin/HivisionIDPhotos/releases/tag/pretrained-model)下载权重文件`hivision_modnet.onnx`,存到根目录下。

<br>

Expand Down Expand Up @@ -118,7 +118,7 @@ python requests_api.py -u http://127.0.0.1:8080 -t generate_layout_photos -i ./i

# 🐳Docker部署

在根目录下执行
在确保将模型权重文件[hivision_modnet.onnx](https://github.com/Zeyi-Lin/HivisionIDPhotos/releases/tag/pretrained-model)放到根目录下后,在根目录执行

```bash
docker build -t hivision_idphotos .
Expand Down
42 changes: 20 additions & 22 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ English / [中文](README.md)
- 2023.5.10: Update **Change the background without changing the size**


<br>

# Overview

> 🚀Thank you for your interest in our work. You may also want to check out our other achievements in the field of image processing. Please feel free to contact us at zeyi.lin@swanhub.co.
Expand All @@ -50,10 +52,11 @@ HivisionIDPhoto aims to develop a practical intelligent algorithm for producing

If HivisionIDPhoto is helpful to you, please star this repo or recommend it to your friends to solve the problem of emergency ID photo production!

<br>

# 🔧Environment Dependencies and Installation

- Python >= 3.7 (Recommend to use [Anaconda](https://www.anaconda.com/download/#linux) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html))
- Python >= 3.7(The main test of the project is in Python 3.10.)
- onnxruntime
- OpenCV
- Option: Linux, Windows, MacOS
Expand All @@ -63,40 +66,33 @@ If HivisionIDPhoto is helpful to you, please star this repo or recommend it to y
1. Clone repo

```bash
git lfs install && git clone https://swanhub.co/ZeYiLin/HivisionIDPhotos.git
git clone https://github.com/Zeyi-Lin/HivisionIDPhotos.git
cd HivisionIDPhotos
```

2. Install dependent packages

```
pip install numpy
pip install opencv-python
pip install onnxruntime
pip install gradio
pip install -r requirements.txt
```

**3. Download Pretrain file**

Download the weight file `hivision_modnet.onnx` from our [Release](https://github.com/Zeyi-Lin/HivisionIDPhotos/releases/tag/pretrained-model) and save it to the root directory.

# ⚡️Quick Inference

<br>

Models and codes are downloaded via git-lfs.

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

**Demo**
# Gradio Demo

```bash
python app.py
```

Running the program will generate a local web page, where operations and interactions with ID photos can be completed.

**Deploy API service**
<br>

# Deploy API service

```
python deploy_api.py
Expand All @@ -123,9 +119,12 @@ Get a six-inch layout photo (input a 3-channel photo, get a six-inch layout phot
```bash
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)'
```

<br>

# 🐳Docker deployment

Execute in the root directory:
After ensuring that the model weight file [hivision_modnet.onnx](https://github.com/Zeyi-Lin/HivisionIDPhotos/releases/tag/pretrained-model) is placed in the root directory, execute in the root directory:

```bash
docker build -t hivision_idphotos .
Expand All @@ -137,17 +136,16 @@ After the image is packaged, run the following command to start the API service:
docker run -p 8080:8080 hivision_idphotos
```





<br>

# Reference Projects

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


<br>

# 📧Contact

If you have any questions, please email Zeyi.lin@swanhub.co
Expand Down

0 comments on commit 29373b6

Please sign in to comment.