admin commited on
Commit
77bfe76
·
1 Parent(s): c758752

refine code & notes

Browse files
Files changed (1) hide show
  1. app.py +4 -14
app.py CHANGED
@@ -63,7 +63,7 @@ def find_images(dir_path: str):
63
  return found_images
64
 
65
 
66
- # outer func
67
  def infer(img_path: str, keep_ext: bool, cache=f"{TMP_DIR}/exif"):
68
  status = "Success"
69
  out_img = out_exif = None
@@ -82,7 +82,6 @@ def infer(img_path: str, keep_ext: bool, cache=f"{TMP_DIR}/exif"):
82
  return status, out_img, out_exif
83
 
84
 
85
- # outer func
86
  def batch_infer(imgs_zip: str, keep_ext: bool, cache=f"{TMP_DIR}/exif"):
87
  status = "Success"
88
  out_images = out_exifs = None
@@ -121,14 +120,8 @@ if __name__ == "__main__":
121
  gr.Interface(
122
  fn=infer,
123
  inputs=[
124
- gr.File(
125
- label=_L("上传图片"),
126
- file_types=["image"],
127
- ),
128
- gr.Checkbox(
129
- label=_L("导出原格式"),
130
- value=False,
131
- ),
132
  ],
133
  outputs=[
134
  gr.Textbox(label=_L("状态栏"), show_copy_button=True),
@@ -150,10 +143,7 @@ if __name__ == "__main__":
150
  label=_L("上传包含多图片的压缩包 (请确保上传完全后再提交)"),
151
  file_types=[".zip", ".7z", ".rar"],
152
  ),
153
- gr.Checkbox(
154
- label=_L("导出原格式"),
155
- value=False,
156
- ),
157
  ],
158
  outputs=[
159
  gr.Textbox(label=_L("状态栏"), show_copy_button=True),
 
63
  return found_images
64
 
65
 
66
+ # outer funcs
67
  def infer(img_path: str, keep_ext: bool, cache=f"{TMP_DIR}/exif"):
68
  status = "Success"
69
  out_img = out_exif = None
 
82
  return status, out_img, out_exif
83
 
84
 
 
85
  def batch_infer(imgs_zip: str, keep_ext: bool, cache=f"{TMP_DIR}/exif"):
86
  status = "Success"
87
  out_images = out_exifs = None
 
120
  gr.Interface(
121
  fn=infer,
122
  inputs=[
123
+ gr.File(label=_L("上传图片"), file_types=["image"]),
124
+ gr.Checkbox(label=_L("导出原格式"), value=False),
 
 
 
 
 
 
125
  ],
126
  outputs=[
127
  gr.Textbox(label=_L("状态栏"), show_copy_button=True),
 
143
  label=_L("上传包含多图片的压缩包 (请确保上传完全后再提交)"),
144
  file_types=[".zip", ".7z", ".rar"],
145
  ),
146
+ gr.Checkbox(label=_L("导出原格式"), value=False),
 
 
 
147
  ],
148
  outputs=[
149
  gr.Textbox(label=_L("状态栏"), show_copy_button=True),