watermark_demo / app.py
meg's picture
meg HF Staff
Update app.py
b83557a verified
raw
history blame
619 Bytes
import gradio as gr
import os
a = os.path.join(os.path.dirname(__file__), "files/convert-to-gradio-sd.mp4")
b = os.path.join(os.path.dirname(__file__), "files/barkley_balloon.mov")
w1 = os.path.join(os.path.dirname(__file__), "files/hf-logo-with-title.png")
w2 = os.path.join(os.path.dirname(__file__), "files/hf-logo.png")
def generate_video(original_video, watermark):
return gr.Video(original_video, watermark=watermark)
demo = gr.Interface(generate_video, [gr.Video(), gr.File()], gr.Video(),
examples=[[a, gr.Image(w1)], [b, gr.Image(w2)]])
if __name__ == "__main__":
demo.launch()