Spaces:
Sleeping
Sleeping
update gradio video43
Browse files
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 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
#
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
#
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
#
|
153 |
-
|
154 |
-
|
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 |
|