CurryMindFree commited on
Commit
24f4f98
·
verified ·
1 Parent(s): 6df2baf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -26
app.py CHANGED
@@ -81,32 +81,17 @@ def run_detection(image_path):
81
  return to_pil_image(result_image_tensor)
82
 
83
 
84
- with gr.Blocks() as demo:
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(type="filepath", label="Upload Image"),
106
- outputs=gr.Image(type="pil",label="Output Image"),
107
-
108
- title="<br>To see the complete code, click Files at upper right corner, in app.py<br><br>FasterRCNN_ResNet50_FPN model detects 91 classes. For demo purpose, it's been adjusted to only detect car and traffic light"
 
 
 
 
 
109
  )
110
 
111
- demo.launch()
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()