hysts HF staff commited on
Commit
84b5da8
β€’
1 Parent(s): b285292
Files changed (4) hide show
  1. README.md +1 -1
  2. app.py +6 -3
  3. model.py +0 -2
  4. style.css +1 -8
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: πŸ“ˆ
4
  colorFrom: yellow
5
  colorTo: purple
6
  sdk: gradio
7
- sdk_version: 3.36.1
8
  app_file: app.py
9
  pinned: false
10
  ---
 
4
  colorFrom: yellow
5
  colorTo: purple
6
  sdk: gradio
7
+ sdk_version: 4.36.1
8
  app_file: app.py
9
  pinned: false
10
  ---
app.py CHANGED
@@ -22,12 +22,15 @@ with gr.Blocks(css="style.css") as demo:
22
  with gr.Row():
23
  input_image = gr.Image(label="Input Image", type="numpy")
24
  with gr.Row():
25
- run_button = gr.Button("Run")
26
  with gr.Column():
27
  with gr.Row():
28
- result = gr.Image(label="Result", type="numpy", elem_id="result")
29
  with gr.Row():
30
  paths = sorted(pathlib.Path("images").glob("*.jpg"))
31
  gr.Examples(examples=[[path.as_posix()] for path in paths], inputs=input_image)
32
  run_button.click(fn=model.run, inputs=input_image, outputs=result, api_name="run")
33
- demo.queue(max_size=20).launch()
 
 
 
 
22
  with gr.Row():
23
  input_image = gr.Image(label="Input Image", type="numpy")
24
  with gr.Row():
25
+ run_button = gr.Button()
26
  with gr.Column():
27
  with gr.Row():
28
+ result = gr.Image(label="Result")
29
  with gr.Row():
30
  paths = sorted(pathlib.Path("images").glob("*.jpg"))
31
  gr.Examples(examples=[[path.as_posix()] for path in paths], inputs=input_image)
32
  run_button.click(fn=model.run, inputs=input_image, outputs=result, api_name="run")
33
+
34
+
35
+ if __name__ == "__main__":
36
+ demo.queue(max_size=20).launch()
model.py CHANGED
@@ -22,8 +22,6 @@ Asher Chan
22
 
23
  from __future__ import annotations
24
 
25
- import os
26
-
27
  import cv2
28
  import huggingface_hub
29
  import numpy as np
 
22
 
23
  from __future__ import annotations
24
 
 
 
25
  import cv2
26
  import huggingface_hub
27
  import numpy as np
style.css CHANGED
@@ -1,5 +1,6 @@
1
  h1 {
2
  text-align: center;
 
3
  }
4
  img#overview {
5
  max-width: 1000px;
@@ -7,11 +8,3 @@ img#overview {
7
  display: block;
8
  margin: auto;
9
  }
10
- div#result {
11
- max-width: 500px;
12
- max-height: 500px;
13
- }
14
- img#visitor-badge {
15
- display: block;
16
- margin: auto;
17
- }
 
1
  h1 {
2
  text-align: center;
3
+ display: block;
4
  }
5
  img#overview {
6
  max-width: 1000px;
 
8
  display: block;
9
  margin: auto;
10
  }