Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,7 @@
|
|
| 1 |
import cv2
|
| 2 |
import gradio as gr
|
| 3 |
-
from pathlib import Path
|
| 4 |
-
from typing import Union, Tuple
|
| 5 |
|
| 6 |
-
def frame_capture(video_path
|
| 7 |
# Function to extract frames
|
| 8 |
vidObj = cv2.VideoCapture(video_path)
|
| 9 |
|
|
@@ -24,15 +22,15 @@ def frame_capture(video_path: str) -> Tuple[str, None]:
|
|
| 24 |
frames.append(image)
|
| 25 |
count += 1
|
| 26 |
|
| 27 |
-
return frames
|
| 28 |
|
| 29 |
-
def extract_frames(video
|
| 30 |
-
frames
|
| 31 |
-
return frames
|
| 32 |
|
| 33 |
# Define the Gradio interface
|
| 34 |
video_input = gr.Video(label="Upload Video")
|
| 35 |
-
output_frames = gr.
|
| 36 |
|
| 37 |
# Create the Gradio app
|
| 38 |
gr.Interface(fn=extract_frames, inputs=video_input, outputs=output_frames, title='Video Frame Extractor').launch()
|
|
|
|
| 1 |
import cv2
|
| 2 |
import gradio as gr
|
|
|
|
|
|
|
| 3 |
|
| 4 |
+
def frame_capture(video_path):
|
| 5 |
# Function to extract frames
|
| 6 |
vidObj = cv2.VideoCapture(video_path)
|
| 7 |
|
|
|
|
| 22 |
frames.append(image)
|
| 23 |
count += 1
|
| 24 |
|
| 25 |
+
return frames
|
| 26 |
|
| 27 |
+
def extract_frames(video):
|
| 28 |
+
frames = frame_capture(video.value)
|
| 29 |
+
return frames
|
| 30 |
|
| 31 |
# Define the Gradio interface
|
| 32 |
video_input = gr.Video(label="Upload Video")
|
| 33 |
+
output_frames = gr.Gallery(label='Frame')
|
| 34 |
|
| 35 |
# Create the Gradio app
|
| 36 |
gr.Interface(fn=extract_frames, inputs=video_input, outputs=output_frames, title='Video Frame Extractor').launch()
|