Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -81,32 +81,17 @@ def run_detection(image_path):
|
|
| 81 |
return to_pil_image(result_image_tensor)
|
| 82 |
|
| 83 |
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
iface = gr.Interface(
|
| 87 |
-
fn=run_detection,
|
| 88 |
-
inputs=gr.Image(type="filepath", label="Upload Image"),
|
| 89 |
-
outputs=gr.Image(type="pil", label="Output Image"),
|
| 90 |
-
title="This app uses:PyTorch Vision. PyTorch Model:ResNet50_FPN"
|
| 91 |
-
)
|
| 92 |
-
gr.Markdown("### The model is adjusted to only detect car and traffic light. Example output:")
|
| 93 |
-
gr.Image(
|
| 94 |
-
value="exap1.JPG",
|
| 95 |
-
show_label=False,
|
| 96 |
-
width=450
|
| 97 |
-
)
|
| 98 |
-
|
| 99 |
-
demo.launch()
|
| 100 |
-
|
| 101 |
-
'''
|
| 102 |
-
demo = gr.Interface(
|
| 103 |
-
|
| 104 |
fn=run_detection,
|
| 105 |
-
inputs=gr.Image(
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
)
|
| 110 |
|
| 111 |
-
|
| 112 |
-
'''
|
|
|
|
| 81 |
return to_pil_image(result_image_tensor)
|
| 82 |
|
| 83 |
|
| 84 |
+
iface = gr.Interface(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
fn=run_detection,
|
| 86 |
+
inputs=gr.Image(
|
| 87 |
+
type="filepath",
|
| 88 |
+
label="Upload Image"
|
| 89 |
+
),
|
| 90 |
+
outputs=gr.Image(
|
| 91 |
+
type="pil",
|
| 92 |
+
label="Output Image"
|
| 93 |
+
),
|
| 94 |
+
title="This app uses PyTorch Vision. PyTorch Model: ResNet50_FPN"
|
| 95 |
)
|
| 96 |
|
| 97 |
+
iface.launch()
|
|
|