2lu commited on
Commit
5b8ecd8
·
1 Parent(s): 769d1f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -137,4 +137,20 @@ def detect_obj(input_image):
137
  return output_pil_img
138
 
139
  except:
140
- return input_image
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  return output_pil_img
138
 
139
  except:
140
+ return input_image
141
+
142
+
143
+ with gr.Blocks(title="YOLOS Object Detection - ClassCat", css=".gradio-container {background:lightyellow;}") as demo:
144
+ gr.HTML('<h1>Yolo Object Detection</h1>')
145
+ gr.HTML("<h4>supported objects are [aeroplane,bicycle,bird,boat,bottle,bus,car,cat,chair,cow,diningtable,dog,horse,motorbike,person,pottedplant,sheep,sofa,train,tvmonitor]</h4>")
146
+ with gr.Row():
147
+ input_image = gr.Image(label="Input image", type="pil")
148
+ output_image = gr.Image(label="Output image", type="pil")
149
+
150
+ send_btn = gr.Button("Detect")
151
+ gr.Examples(['./samples/out_1.jpg'], inputs=input_image)
152
+
153
+ send_btn.click(fn=detect_obj, inputs=[input_image], outputs=[output_image])
154
+
155
+
156
+ demo.launch(debug=True)