Spaces:
Sleeping
Sleeping
File size: 868 Bytes
40e52db 2f4d69c f3c7782 72c97c8 6e83c08 40e52db b024c7c 40e52db 6477da7 f88f61a 40e52db |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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.mp4")
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)
# Use RGBA image mode to preserve transparency for png images.
demo = gr.Interface(generate_video, [gr.Video(), gr.Image(type='filepath', image_mode='RGBA')], gr.Video(),
examples=[[a, w1], [b, w2]], title="Watermarking Example", description="Watermarks can be **visible** or **invisible**; they can provide information directly or provide a link for more information.")
if __name__ == "__main__":
demo.launch() |