TzuShianYang commited on
Commit
b74123f
·
1 Parent(s): c6bd672

Add Chinese on button and accordion for guide

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -34,11 +34,11 @@ def zip_gallery(gallery):
34
  zf.close()
35
  gr.Info(f"Zip Complete. Name: {new_zip_name}")
36
 
37
- return gr.DownloadButton("Download", value=new_zip_name, visible=True)
38
 
39
 
40
  with gr.Blocks(fill_height=True) as demo:
41
- with gr.Row():
42
  gr.Markdown(
43
  """
44
  # How to Use
@@ -67,13 +67,13 @@ with gr.Blocks(fill_height=True) as demo:
67
  with gr.Column():
68
  camera = gr.Image(type="pil", format="png", webcam_constraints={
69
  "video": {"width": 640, "height": 640}}, sources="webcam", mirror_webcam=False, scale=0)
70
- catch_btn = gr.Button("Capture", scale=0)
71
  with gr.Column():
72
  preview_img = gr.Image(visible=False)
73
  gallery = gr.Gallery(
74
  label="Collected images", show_label=False, elem_id="gallery", columns=[10], rows=[4], object_fit="contain", height="auto")
75
- zip_btn = gr.Button("Zip file")
76
- download_btn = gr.DownloadButton("Download", visible=False)
77
 
78
  catch_btn.click(add_image, [preview_img, gallery], [gallery])
79
  camera.stream(lambda s: s, camera, preview_img)
 
34
  zf.close()
35
  gr.Info(f"Zip Complete. Name: {new_zip_name}")
36
 
37
+ return gr.DownloadButton("Download/下載", value=new_zip_name, visible=True)
38
 
39
 
40
  with gr.Blocks(fill_height=True) as demo:
41
+ with gr.Accordion("How to Use/使用說明"):
42
  gr.Markdown(
43
  """
44
  # How to Use
 
67
  with gr.Column():
68
  camera = gr.Image(type="pil", format="png", webcam_constraints={
69
  "video": {"width": 640, "height": 640}}, sources="webcam", mirror_webcam=False, scale=0)
70
+ catch_btn = gr.Button("Capture/拍照", scale=0)
71
  with gr.Column():
72
  preview_img = gr.Image(visible=False)
73
  gallery = gr.Gallery(
74
  label="Collected images", show_label=False, elem_id="gallery", columns=[10], rows=[4], object_fit="contain", height="auto")
75
+ zip_btn = gr.Button("Zip file/打包照片")
76
+ download_btn = gr.DownloadButton("Download/下載", visible=False)
77
 
78
  catch_btn.click(add_image, [preview_img, gallery], [gallery])
79
  camera.stream(lambda s: s, camera, preview_img)