Ubuntu
a
ce6d9ab
raw
history blame
570 Bytes
import gradio as gr
import os
import cv2
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)