Spaces:
Runtime error
Runtime error
Zengyf-CVer
commited on
Commit
•
9a8e61c
1
Parent(s):
0e63280
app update
Browse files- README.md +1 -1
- app.py +20 -0
- img_examples/bus.jpg +0 -0
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: 📈
|
|
4 |
colorFrom: indigo
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 3.1.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: gpl-3.0
|
|
|
4 |
colorFrom: indigo
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 3.1.8b0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: gpl-3.0
|
app.py
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def yolo_det_img(img):
|
4 |
+
return img
|
5 |
+
|
6 |
+
inputs_img = gr.Image(image_mode="RGB", source="upload", tool="editor", type="pil", label="原始图片")
|
7 |
+
outputs_img = gr.Image(type="pil", label="检测图片")
|
8 |
+
examples_img = [["./img_examples/bus.jpg"]]
|
9 |
+
|
10 |
+
gyd_img = gr.Interface(
|
11 |
+
fn=yolo_det_img,
|
12 |
+
inputs=inputs_img,
|
13 |
+
outputs=outputs_img,
|
14 |
+
examples=examples_img,
|
15 |
+
flagging_dir="run", # 输出目录
|
16 |
+
)
|
17 |
+
|
18 |
+
gyd_img.launch(
|
19 |
+
inbrowser=True, # 自动打开默认浏览器
|
20 |
+
)
|
img_examples/bus.jpg
ADDED