apailang commited on
Commit
0052927
β€’
1 Parent(s): 11704ad

update gradio video43

Browse files
Files changed (1) hide show
  1. app.py +28 -28
app.py CHANGED
@@ -124,33 +124,33 @@ detection_model = load_model()
124
  # predicted_img.save('predicted.jpg')
125
 
126
 
127
- gr.Interface(fn=predict,
128
- inputs=gr.Image(type="pil"),
129
- outputs=gr.Image(type="pil")
130
- ).launch(share=True)
131
-
132
- # # First interface for image prediction
133
- # image_interface = gr.Interface(
134
- # fn=predict,
135
- # inputs=gr.Image(type="pil"),
136
- # outputs=gr.Image(type="pil"),
137
- # title="Image Prediction Interface",
138
- # description="Upload an image for prediction"
139
- # )
140
-
141
- # # Second interface for video prediction
142
- # video_interface = gr.Interface(
143
- # fn=detect_video,
144
- # inputs=gr.Video(type="mp4"),
145
- # outputs=gr.Video(type="auto"),
146
- # title="Video Prediction Interface",
147
- # description="Upload a video for prediction",
148
- # live=True, # Enable live video processing
149
- # interpretation="default", # Display video player controls
150
- # )
151
-
152
- # # Launch both interfaces
153
- # image_interface.launch(share=True)
154
- # video_interface.launch(share=True)
155
 
156
 
 
124
  # predicted_img.save('predicted.jpg')
125
 
126
 
127
+ # gr.Interface(fn=predict,
128
+ # inputs=gr.Image(type="pil"),
129
+ # outputs=gr.Image(type="pil")
130
+ # ).launch(share=True)
131
+
132
+ # First interface for image prediction
133
+ image_interface = gr.Interface(
134
+ fn=predict,
135
+ inputs=gr.Image(type="pil"),
136
+ outputs=gr.Image(type="pil"),
137
+ title="Image Prediction Interface",
138
+ description="Upload an image for prediction"
139
+ )
140
+
141
+ # Second interface for video prediction
142
+ video_interface = gr.Interface(
143
+ fn=detect_video,
144
+ inputs=gr.Video(type="mp4"),
145
+ outputs=gr.Video(type="auto"),
146
+ title="Video Prediction Interface",
147
+ description="Upload a video for prediction",
148
+ live=True, # Enable live video processing
149
+ interpretation="default", # Display video player controls
150
+ )
151
+
152
+ # Launch both interfaces
153
+ image_interface.launch(share=True)
154
+ video_interface.launch(share=True)
155
 
156