Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -84,26 +84,34 @@ def detect_video(video_path):
84
  # Create Gradio interfaces for different modes
85
  img_interface = gr.Interface(
86
  fn=detect_image,
 
87
  inputs=gr.inputs.Image(source="upload"),
88
  outputs="image",
89
- title="Image"
 
90
  )
91
 
92
  vid_interface = gr.Interface(
93
  fn=detect_video,
94
  inputs=gr.inputs.Video(source="upload"),
 
 
 
 
 
 
 
95
  outputs="video",
96
- title="Video"
 
97
  )
98
 
99
  # Add examples
100
  # with gr.Blocks() as demo:
101
  # gr.Examples(
102
- # examples=[os.path.join(os.path.abspath(''), "plastic_bottles1.jpg")],
103
  # inputs= "image",
104
  # outputs= "image",
105
  # fn=detect_image,
106
- # cache_examples=True,
107
  # )
108
 
109
  # Create a list of interfaces
 
84
  # Create Gradio interfaces for different modes
85
  img_interface = gr.Interface(
86
  fn=detect_image,
87
+ examples=[os.path.join(os.path.abspath(''), "plastic_bottles1.jpg")],
88
  inputs=gr.inputs.Image(source="upload"),
89
  outputs="image",
90
+ title="Image",
91
+ cache_examples=True
92
  )
93
 
94
  vid_interface = gr.Interface(
95
  fn=detect_video,
96
  inputs=gr.inputs.Video(source="upload"),
97
+ examples=[
98
+ os.path.join(os.path.abspath(''), "a-plastic-bag-is-floating-in-a-sea-ocean-plastic-pollution-big-environmental-p-SBV-347235576-preview.mp4"),
99
+ os.path.join(os.path.abspath(''), "hand-woman-in-yellow-gloves-picking-up-empty-plastic-bottles-cleaning-on-the-b-SBV-346452144-preview.mp4"),
100
+ os.path.join(os.path.abspath(''), "plastic-bottle-being-dumped-in-to-the-sea-ocean-pollution-in-ocean-is-a-big-en-SBV-347235586-preview.mp4"),
101
+ os.path.join(os.path.abspath(''), "pollution-garbages-plastic-and-wastes-on-the-beach-after-winter-storms-SBV-331355306-preview.mp4"),
102
+ os.path.join(os.path.abspath(''), "volunteer-woman-picking-plastic-bottle-into-trash-plastic-bag-black-for-cleani-SBV-346871657-preview.mp4")
103
+ ],
104
  outputs="video",
105
+ title="Video",
106
+ cache_examples=True
107
  )
108
 
109
  # Add examples
110
  # with gr.Blocks() as demo:
111
  # gr.Examples(
 
112
  # inputs= "image",
113
  # outputs= "image",
114
  # fn=detect_image,
 
115
  # )
116
 
117
  # Create a list of interfaces