Spaces:
Runtime error
Runtime error
File size: 697 Bytes
c84f4aa 56d7879 c84f4aa 56d7879 c84f4aa c0d1687 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
import os
from torchvision.io import read_video,write_video
def video_identity(video):
video, _, _ = read_video(video, output_format="TCHW")
return type(video)
with gr.Blocks() as demo:
vid = gr.Video()
vid_out = gr.Video()
text = gr.Textbox()
vid.upload(fn = video_identity, inputs = [vid], outputs=[text])
# demo = gr.Interface(video_identity,
# gr.Video(),
# "playable_video",
# # examples=[
# # os.path.join(os.path.abspath(''),
# # "video/video_sample.mp4")],
# )
if __name__ == "__main__":
demo.launch() |