Spaces:
Sleeping
Sleeping
Commit ·
f066199
1
Parent(s): 23b9701
modify app.py
Browse files
app.py
CHANGED
|
@@ -34,7 +34,7 @@ def process_video(video_file):
|
|
| 34 |
# Save the frame to the temporary directory
|
| 35 |
frame_path = os.path.join(temp_dir, f"frame_{frame_count}.jpg")
|
| 36 |
cv2.imwrite(frame_path, frame)
|
| 37 |
-
results = model.predict(source=frame_path, conf=0.
|
| 38 |
for result in results:
|
| 39 |
boxes = result.boxes
|
| 40 |
# result.save(filename=frame_path)
|
|
@@ -62,9 +62,9 @@ def process_video(video_file):
|
|
| 62 |
iface = gr.Interface(
|
| 63 |
fn=process_video, # Function to process the video and return extracted frames
|
| 64 |
inputs=gr.Video(label="Upload your video"), # Video upload input
|
| 65 |
-
outputs=gr.Gallery(label="
|
| 66 |
-
title="
|
| 67 |
-
description="Upload a video, extract 5 frames per second, resize if necessary, and display extracted frames."
|
| 68 |
)
|
| 69 |
|
| 70 |
# Launch the Gradio app
|
|
|
|
| 34 |
# Save the frame to the temporary directory
|
| 35 |
frame_path = os.path.join(temp_dir, f"frame_{frame_count}.jpg")
|
| 36 |
cv2.imwrite(frame_path, frame)
|
| 37 |
+
results = model.predict(source=frame_path, conf=0.2, save=False, show=False, line_width=2, show_labels=True, show_boxes=True, retina_masks=True)
|
| 38 |
for result in results:
|
| 39 |
boxes = result.boxes
|
| 40 |
# result.save(filename=frame_path)
|
|
|
|
| 62 |
iface = gr.Interface(
|
| 63 |
fn=process_video, # Function to process the video and return extracted frames
|
| 64 |
inputs=gr.Video(label="Upload your video"), # Video upload input
|
| 65 |
+
outputs=gr.Gallery(label="Output Images Results"), # Display extracted frames in a gallery
|
| 66 |
+
title="Road Damage Detection" # Interface title
|
| 67 |
+
# description="Upload a video, extract 5 frames per second, resize if necessary, and display extracted frames."
|
| 68 |
)
|
| 69 |
|
| 70 |
# Launch the Gradio app
|