YEHTUT commited on
Commit
c54e670
1 Parent(s): 21e153e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -11,6 +11,7 @@ import wget
11
  import gradio as gr
12
  from huggingface_hub import snapshot_download
13
  import os
 
14
 
15
  PATH_TO_LABELS = 'data/label_map.pbtxt'
16
  category_index = label_map_util.create_category_index_from_labelmap(PATH_TO_LABELS, use_display_name=True)
@@ -130,11 +131,17 @@ detection_model = load_model()
130
  # predicted_img.save('predicted.jpg')
131
  Image_tab = gr.Interface(fn=predict,
132
  inputs=gr.Image(type="pil"),
133
- outputs=gr.Image(type="pil")
 
 
 
134
  )
135
  Video_tab = gr.Interface(fn=predict_video,
136
  inputs=gr.File(label="Upload Video"),
137
- outputs=gr.File(label="Detected Video")
 
 
 
138
  )
139
 
140
  gr.TabbedInterface([Image_tab, Video_tab], ["Image", "Video"]).launch(share=True)
 
11
  import gradio as gr
12
  from huggingface_hub import snapshot_download
13
  import os
14
+ import cv2
15
 
16
  PATH_TO_LABELS = 'data/label_map.pbtxt'
17
  category_index = label_map_util.create_category_index_from_labelmap(PATH_TO_LABELS, use_display_name=True)
 
131
  # predicted_img.save('predicted.jpg')
132
  Image_tab = gr.Interface(fn=predict,
133
  inputs=gr.Image(type="pil"),
134
+ outputs=gr.Image(type="pil"),
135
+ examples=[["SampleImage1.jpg"],["SampleImage2.jpg"],["SampleImage3.jpg"],["SampleImage4.jpg"],["SampleImage5.jpg"],["SampleImage6.jpg"]],
136
+ title="This is the object detection model for Durian and Pineapple images",
137
+ description="Using ssd_mobilenet_v2_320x320_coco17_tpu-8 to detect Durina and Pineapple"
138
  )
139
  Video_tab = gr.Interface(fn=predict_video,
140
  inputs=gr.File(label="Upload Video"),
141
+ outputs=gr.File(label="Detected Video"),
142
+ examples=[["SampleVideo1.mp4"],["SampleVideo2.mp4"]],
143
+ title="This is the object detection model for Durian and Pineapple videos",
144
+ description="Using ssd_mobilenet_v2_320x320_coco17_tpu-8 to detect Durina and Pineapple"
145
  )
146
 
147
  gr.TabbedInterface([Image_tab, Video_tab], ["Image", "Video"]).launch(share=True)