Skip to content

Commit

Permalink
feat: image dpi (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeyi-Lin authored Sep 14, 2024
1 parent 173682a commit 24a22f7
Show file tree
Hide file tree
Showing 5 changed files with 448 additions and 255 deletions.
3 changes: 3 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

root_dir = os.path.dirname(os.path.abspath(__file__))

# 获取存在的人像分割模型列表
# 通过检查 hivision/creator/weights 目录下的 .onnx 和 .mnn 文件
# 只保留文件名(不包括扩展名)
HUMAN_MATTING_MODELS_EXIST = [
os.path.splitext(file)[0]
for file in os.listdir(os.path.join(root_dir, "hivision/creator/weights"))
Expand Down
22 changes: 20 additions & 2 deletions demo/locals.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,24 @@
"label": "KB 大小",
},
},
"image_dpi": {
"en": {
"label": "Set DPI",
"choices": ["Not Set", "Custom"],
},
"zh": {
"label": "设置 DPI 大小",
"choices": ["不设置", "自定义"],
},
},
"image_dpi_size": {
"en": {
"label": "DPI size",
},
"zh": {
"label": "DPI 大小",
},
},
"render_mode": {
"en": {
"label": "Render mode",
Expand Down Expand Up @@ -278,10 +296,10 @@
},
"download": {
"en": {
"label": "Download the photo after adjusting the KB size",
"label": "Download the photo after adjusting the DPI or KB size",
},
"zh": {
"label": "下载调整 KB 大小后的照片",
"label": "下载调整 DPI 或 KB 大小后的照片",
},
},
"matting_image": {
Expand Down
Loading

0 comments on commit 24a22f7

Please sign in to comment.