Skip to content

Commit

Permalink
docs: README add inference
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeyi-Lin committed Sep 4, 2024
1 parent 51928ef commit b8e50da
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,32 @@ python app.py

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

# 🚀 Python 推理

## 1. 证件照制作

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

```python
python inference.py -i images/test.jpg -o ./idphoto.png -s '(413,295)'
```

## 2. 增加底色

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

```python
python inference.py -t add_background -i ./idphoto.png -o ./idhoto_ab.jpg -c '(0,0,0)' -k 30
```

## 3. 得到六寸排版照

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

```python
python inference.py -t generate_layout_photos -i ./idhoto_ab.jpg -o ./idhoto_layout.jpg -s '(413,295)' -k 200
```

<br>

# ⚡️ 部署 API 服务
Expand All @@ -103,7 +129,9 @@ API 文档:[Python](docs/python_api_CN.md) | RestAPI(waiting)
**启动后端**

```
python deploy_api.py
```

**请求 API 服务 - Python**
Expand Down

0 comments on commit b8e50da

Please sign in to comment.