Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add inference py #38

Merged
merged 4 commits into from
Sep 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: README add inference
  • Loading branch information
Zeyi-Lin committed Sep 4, 2024
commit b8e50dad76bb0fd76623c2b7c92782cb055ecb4e
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