Spaces:
Runtime error
Runtime error
AndreySokolov01
commited on
Commit
•
cef68e0
1
Parent(s):
ec2de63
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,10 @@ def extract_clip(video_path, clip_start, clip_duration):
|
|
15 |
# ... (rest of your extract_clip function)
|
16 |
|
17 |
def display_frames(frames):
|
18 |
-
#
|
|
|
|
|
|
|
19 |
|
20 |
# Install OpenCV if not already installed
|
21 |
install_opencv()
|
|
|
15 |
# ... (rest of your extract_clip function)
|
16 |
|
17 |
def display_frames(frames):
|
18 |
+
num_cols = 4 # Number of columns in the image grid
|
19 |
+
num_rows = (len(frames) + num_cols - 1) // num_cols
|
20 |
+
grid_image = cv2.hconcat([cv2.hconcat(frames[i:i+num_cols]) for i in range(0, len(frames), num_cols)])
|
21 |
+
return grid_image
|
22 |
|
23 |
# Install OpenCV if not already installed
|
24 |
install_opencv()
|