noumanjavaid commited on
Commit
52ffb7e
·
verified ·
1 Parent(s): a0b93f8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -27
app.py CHANGED
@@ -30,18 +30,6 @@ img {
30
  }
31
  """
32
 
33
- # Optional CSS stuff for the header example image:
34
- #example {
35
- # width: 80%;
36
- # height: 60%
37
- #}
38
-
39
- #example img {
40
- # width: 80%;
41
- # height: 80%
42
- #}
43
-
44
-
45
  a = os.path.join(os.path.dirname(__file__), "files/barkley_balloon.mp4")
46
  b = os.path.join(os.path.dirname(__file__), "files/eiffel_tower.mp4")
47
  w1 = os.path.join(os.path.dirname(__file__), "files/AI_generated.png")
@@ -51,29 +39,41 @@ def generate_video(original_video, watermark):
51
 
52
  # Use RGBA image mode to preserve transparency for png images.
53
  with gr.Blocks(css=css) as demo:
54
- with gr.Row():
55
- with gr.Column():
56
  gr.Markdown("# Centurion Watermarking")
57
  gr.Markdown("Watermarks can be **visible** or **invisible**.")
58
  gr.Markdown("""They can provide information directly, or provide a link for more information.
59
- - Visible watermarks are useful to disclose when content is AI-generated.
60
- - Invisible watermarks can mark content as authentic.
61
- - ...And vice versa! There are many possibilities for what watermarks can provide.""")
62
- with gr.Column():
63
- with gr.Column():
64
- gr.Image('files/watermark_example.png', visible=False)
65
- with gr.Column():
66
- gr.Image('files/watermark_example.png', show_label=False, show_download_button=False, elem_id='example', container=False, interactive=False)
67
- gr.Code('import gradio as gr\n\nwatermarked_video = gr.Video(original_video_file, watermark=watermark_file)', lines=3)
68
  with gr.Column():
69
- gr.Image('files/watermark_example.png', visible=False)
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  with gr.Row():
71
  with gr.Column():
72
  gr.Markdown("**Inputs**: Video and watermark file")
73
  with gr.Column():
74
  gr.Markdown("**Output**: Watermarked video")
75
- gr.Interface(generate_video, [gr.Video(), gr.Image(type='filepath', image_mode=None)], gr.Video(),
76
- examples=[[a, w1], [b, w2], [a, w3], [b, w4]])
 
 
 
 
 
77
 
78
  if __name__ == "__main__":
79
- demo.launch()
 
30
  }
31
  """
32
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  a = os.path.join(os.path.dirname(__file__), "files/barkley_balloon.mp4")
34
  b = os.path.join(os.path.dirname(__file__), "files/eiffel_tower.mp4")
35
  w1 = os.path.join(os.path.dirname(__file__), "files/AI_generated.png")
 
39
 
40
  # Use RGBA image mode to preserve transparency for png images.
41
  with gr.Blocks(css=css) as demo:
42
+ with gr.Row():
43
+ with gr.Column():
44
  gr.Markdown("# Centurion Watermarking")
45
  gr.Markdown("Watermarks can be **visible** or **invisible**.")
46
  gr.Markdown("""They can provide information directly, or provide a link for more information.
47
+ - Visible watermarks are useful to disclose when content is AI-generated.
48
+ - Invisible watermarks can mark content as authentic.
49
+ - ...And vice versa! There are many possibilities for what watermarks can provide.""")
 
 
 
 
 
 
50
  with gr.Column():
51
+ with gr.Column():
52
+ gr.Image('files/watermark_example.png', visible=False)
53
+ with gr.Column():
54
+ gr.Image('files/watermark_example.png',
55
+ show_label=False,
56
+ show_download_button=False,
57
+ elem_id='example',
58
+ container=False,
59
+ interactive=False)
60
+ gr.Code('import gradio as gr\n\nwatermarked_video = gr.Video(original_video_file, watermark=watermark_file)',
61
+ lines=3)
62
+ with gr.Column():
63
+ gr.Image('files/watermark_example.png', visible=False)
64
+
65
  with gr.Row():
66
  with gr.Column():
67
  gr.Markdown("**Inputs**: Video and watermark file")
68
  with gr.Column():
69
  gr.Markdown("**Output**: Watermarked video")
70
+
71
+ gr.Interface(
72
+ generate_video,
73
+ [gr.Video(), gr.Image(type='filepath', image_mode=None)],
74
+ gr.Video(),
75
+ examples=[[a, w1], [b, w2], [a, w3], [b, w4]]
76
+ )
77
 
78
  if __name__ == "__main__":
79
+ demo.launch()