CurryMindFree commited on
Commit
395bd21
·
verified ·
1 Parent(s): e7dae87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -81,7 +81,22 @@ def run_detection(image_path):
81
  return to_pil_image(result_image_tensor)
82
 
83
 
 
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  demo = gr.Interface(
86
 
87
  fn=run_detection,
@@ -91,4 +106,5 @@ demo = gr.Interface(
91
  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"
92
  )
93
 
94
- demo.launch()
 
 
81
  return to_pil_image(result_image_tensor)
82
 
83
 
84
+ with gr.Blocks() as demo:
85
 
86
+ gr.Image(
87
+ value="exap1.JPG",
88
+ )
89
+
90
+ iface = gr.Interface(
91
+ fn=run_detection,
92
+ inputs=gr.Image(type="filepath", label="Upload Image"),
93
+ outputs=gr.Image(type="pil", label="Output Image"),
94
+ title="<br>To see the complete code, click Files at upper right corner, in app.py<br><br>The model is adjusted to only detect car and traffic light.<br>Example output:"
95
+ )
96
+
97
+ demo.launch()
98
+
99
+ '''
100
  demo = gr.Interface(
101
 
102
  fn=run_detection,
 
106
  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"
107
  )
108
 
109
+ demo.launch()
110
+ '''