Spaces:
Runtime error
Runtime error
import gradio as gr | |
import os | |
css = """ | |
p { | |
font-size: 120%; | |
} | |
li { | |
font-size: 110 %; | |
} | |
.container { | |
height: initial; | |
} | |
video { | |
max-height: 400px; | |
} | |
.image-container { | |
width: 200px; | |
max-height: 300px; | |
margin: auto; | |
} | |
img { | |
width: auto; | |
height: auto; | |
} | |
""" | |
def generate_video(original_video, watermark): | |
return gr.Video(original_video, watermark=watermark) | |
# Use RGBA image mode to preserve transparency for png images. | |
with gr.Column(): | |
gr.Image('', visible=False) | |
with gr.Column(): | |
gr.Image( | |
show_label=False, | |
show_download_button=False, | |
elem_id='example', | |
container=False, | |
interactive=False) | |
with gr.Row(): | |
with gr.Column(): | |
gr.Markdown("**Inputs**: Video and watermark file") | |
with gr.Column(): | |
gr.Markdown("**Output**: Watermarked video") | |
gr.Interface( | |
generate_video, | |
[gr.Video(), gr.Image(type='filepath', image_mode=None)], | |
gr.Video(), | |
) | |
if __name__ == "__main__": | |
demo.launch() | |