Spaces:
Build error
Build error
Commit Β·
4d7c5a6
1
Parent(s): 807c35c
changed sequence
Browse files
app.py
CHANGED
|
@@ -58,29 +58,8 @@ with demo:
|
|
| 58 |
input_image_watermark = gr.Image(label="Upload an Image", tool="sketch", type="pil", interactive=True)
|
| 59 |
image_remove_btn = gr.Button("Remove Watermark", interactive=True, elem_id="remove_btn")
|
| 60 |
output_image_clean = gr.Image(label="Output Image", interactive=True)
|
| 61 |
-
|
| 62 |
-
image_remove_btn.click(remove_image_watermark, inputs=[input_image_watermark], outputs=[output_image_clean])
|
| 63 |
|
| 64 |
-
|
| 65 |
-
gr.Markdown("""
|
| 66 |
-
# <center>π₯ Video Watermark Remover (Slow)</center>
|
| 67 |
-
""")
|
| 68 |
-
with gr.Row():
|
| 69 |
-
with gr.Column():
|
| 70 |
-
input_video = gr.Video(label="Upload a Video")
|
| 71 |
-
with gr.Column():
|
| 72 |
-
mask = gr.Image(label="Create a mask for the image", tool="sketch", type="pil", interactive=False)
|
| 73 |
-
with gr.Row():
|
| 74 |
-
with gr.Column():
|
| 75 |
-
pass
|
| 76 |
-
with gr.Column():
|
| 77 |
-
remove_btn = gr.Button("Remove Watermark", interactive=False, elem_id="remove_btn")
|
| 78 |
-
with gr.Column():
|
| 79 |
-
pass
|
| 80 |
-
|
| 81 |
-
output_video = gr.Video(label="Output Video", interactive=False)
|
| 82 |
-
input_video.change(convert_video_to_frames, inputs=[input_video], outputs=[mask, remove_btn])
|
| 83 |
-
remove_btn.click(remove_watermark, inputs=[mask], outputs=[output_video, remove_btn])
|
| 84 |
|
| 85 |
with gr.Tab("Video Convertor"):
|
| 86 |
gr.Markdown("""
|
|
@@ -109,7 +88,27 @@ with demo:
|
|
| 109 |
format_select.change(lambda x: gr.Radio.update(choices=video_format if x == "Video" else audio_format, interactive=True), inputs=[format_select], outputs=[format])
|
| 110 |
format.change(lambda x: gr.Button.update(interactive=True), None, outputs=[convert_btn])
|
| 111 |
convert_btn.click(convert_video, inputs=[input_video, format], outputs=[output, status])
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
|
| 114 |
gr.Markdown("""## <center style="margin:20px;">Developed by Muhammad Ahmed<img src="https://avatars.githubusercontent.com/u/63394104?v=4" style="height:50px;width:50px;border-radius:50%;margin:5px;"></img></center>
|
| 115 |
""")
|
|
|
|
| 58 |
input_image_watermark = gr.Image(label="Upload an Image", tool="sketch", type="pil", interactive=True)
|
| 59 |
image_remove_btn = gr.Button("Remove Watermark", interactive=True, elem_id="remove_btn")
|
| 60 |
output_image_clean = gr.Image(label="Output Image", interactive=True)
|
|
|
|
|
|
|
| 61 |
|
| 62 |
+
image_remove_btn.click(remove_image_watermark, inputs=[input_image_watermark], outputs=[output_image_clean])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
with gr.Tab("Video Convertor"):
|
| 65 |
gr.Markdown("""
|
|
|
|
| 88 |
format_select.change(lambda x: gr.Radio.update(choices=video_format if x == "Video" else audio_format, interactive=True), inputs=[format_select], outputs=[format])
|
| 89 |
format.change(lambda x: gr.Button.update(interactive=True), None, outputs=[convert_btn])
|
| 90 |
convert_btn.click(convert_video, inputs=[input_video, format], outputs=[output, status])
|
| 91 |
+
|
| 92 |
+
with gr.Tab("Video Watermark Remover"):
|
| 93 |
+
gr.Markdown("""
|
| 94 |
+
# <center>π₯ Video Watermark Remover (Slow)</center>
|
| 95 |
+
""")
|
| 96 |
+
with gr.Row():
|
| 97 |
+
with gr.Column():
|
| 98 |
+
input_video = gr.Video(label="Upload a Video")
|
| 99 |
+
with gr.Column():
|
| 100 |
+
mask = gr.Image(label="Create a mask for the image", tool="sketch", type="pil", interactive=False)
|
| 101 |
+
with gr.Row():
|
| 102 |
+
with gr.Column():
|
| 103 |
+
pass
|
| 104 |
+
with gr.Column():
|
| 105 |
+
remove_btn = gr.Button("Remove Watermark", interactive=False, elem_id="remove_btn")
|
| 106 |
+
with gr.Column():
|
| 107 |
+
pass
|
| 108 |
+
|
| 109 |
+
output_video = gr.Video(label="Output Video", interactive=False)
|
| 110 |
+
input_video.change(convert_video_to_frames, inputs=[input_video], outputs=[mask, remove_btn])
|
| 111 |
+
remove_btn.click(remove_watermark, inputs=[mask], outputs=[output_video, remove_btn])
|
| 112 |
|
| 113 |
gr.Markdown("""## <center style="margin:20px;">Developed by Muhammad Ahmed<img src="https://avatars.githubusercontent.com/u/63394104?v=4" style="height:50px;width:50px;border-radius:50%;margin:5px;"></img></center>
|
| 114 |
""")
|