Spaces:
Sleeping
Sleeping
import gradio as gr | |
import os | |
import cv2 | |
from encoded_video import EncodedVideo, write_video | |
def video_identity(filepath): | |
vid = EncodedVideo.from_path(filepath) | |
while (True): | |
success, frame = capture.read() | |
if success: | |
cv2.imwrite(f'train/frame_{frameNr}.jpg', frame) | |
else: | |
break | |
frameNr = frameNr+10 | |
img=cv2.imread('train/frame_0') | |
return img | |
demo = gr.Interface(video_identity, | |
gr.inputs.Video(source_upload), | |
gr.inputs.Image(), | |
cache_examples=True) | |
demo.launch(debug=True) |