meg HF staff commited on
Commit
40e52db
1 Parent(s): 0144cd1

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import os
3
+
4
+ a = os.path.join(os.path.dirname(__file__), "files/a.mp4")
5
+ b = os.path.join(os.path.dirname(__file__), "files/b.mp4")
6
+ w1 = os.path.join(os.path.dirname(__file__), "files/w1.jpg")
7
+ w2 = os.path.join(os.path.dirname(__file__), "files/w2.png")
8
+
9
+ def generate_video(original_video, watermark):
10
+ return gr.Video(original_video, watermark=watermark)
11
+
12
+
13
+ demo = gr.Interface(generate_video, [gr.Video(), gr.File()], gr.Video(),
14
+ examples=[[a, w1], [b, w2]])
15
+
16
+ if __name__ == "__main__":
17
+ demo.launch()