Spaces:
Runtime error
Runtime error
Linoy Tsaban
commited on
Commit
·
c84f4aa
1
Parent(s):
5d70f50
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
+
from torchvision.io import read_video,write_video
|
| 4 |
+
def video_identity(video):
|
| 5 |
+
video, _, _ = read_video(video, output_format="TCHW")
|
| 6 |
+
return video
|
| 7 |
+
|
| 8 |
+
with gr.Blocks() as demo:
|
| 9 |
+
vid = gr.Video()
|
| 10 |
+
vid_out = gr.Video()
|
| 11 |
+
text = gr.Textbox()
|
| 12 |
+
vid.upload(fn = video_identity, inputs = [vid], outputs=[vid_out])
|
| 13 |
+
# demo = gr.Interface(video_identity,
|
| 14 |
+
# gr.Video(),
|
| 15 |
+
# "playable_video",
|
| 16 |
+
# # examples=[
|
| 17 |
+
# # os.path.join(os.path.abspath(''),
|
| 18 |
+
# # "video/video_sample.mp4")],
|
| 19 |
+
# )
|
| 20 |
+
|
| 21 |
+
if __name__ == "__main__":
|
| 22 |
+
demo.launch(debug=True)
|