Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -100,18 +100,39 @@ def infer(video_in):
|
|
100 |
|
101 |
return final_vid, files
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
with gr.Blocks() as demo:
|
104 |
-
with gr.
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
|
|
|
|
110 |
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
|
115 |
-
|
116 |
|
117 |
demo.launch()
|
|
|
100 |
|
101 |
return final_vid, files
|
102 |
|
103 |
+
title="""
|
104 |
+
<div style="text-align: center; max-width: 500px; margin: 0 auto;">
|
105 |
+
<div
|
106 |
+
style="
|
107 |
+
display: inline-flex;
|
108 |
+
align-items: center;
|
109 |
+
gap: 0.8rem;
|
110 |
+
font-size: 1.75rem;
|
111 |
+
margin-bottom: 10px;
|
112 |
+
"
|
113 |
+
>
|
114 |
+
<h1 style="font-weight: 600; margin-bottom: 7px;">
|
115 |
+
Video to Canny Edge
|
116 |
+
</h1>
|
117 |
+
</div>
|
118 |
+
|
119 |
+
</div>
|
120 |
+
"""
|
121 |
+
|
122 |
with gr.Blocks() as demo:
|
123 |
+
with gr.Column():
|
124 |
+
gr.HTML(title)
|
125 |
+
with gr.Row():
|
126 |
+
with gr.Column():
|
127 |
+
video_input = gr.Video(source="upload", type="filepath")
|
128 |
+
gif_input = gr.File(label="import a GIF instead", file_types=['.gif'])
|
129 |
+
gif_input.change(fn=convertG2V, inputs=gif_input, outputs=video_input)
|
130 |
+
submit_btn = gr.Button("Submit")
|
131 |
|
132 |
+
with gr.Column():
|
133 |
+
video_output = gr.Video()
|
134 |
+
file_output = gr.Files()
|
135 |
|
136 |
+
submit_btn.click(fn=infer, inputs=[video_input], outputs=[video_output, file_output])
|
137 |
|
138 |
demo.launch()
|