RaphaelLiu
commited on
Commit
·
5f274b4
1
Parent(s):
91ba3cc
Update content
Browse files
app.py
CHANGED
@@ -3,6 +3,14 @@ import os
|
|
3 |
|
4 |
css = """
|
5 |
<style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
.gallery-container {
|
8 |
display: flex;
|
@@ -193,7 +201,7 @@ def showcase(page_num):
|
|
193 |
|
194 |
for category in ['VideoCrafter2', 'Pika', 'VideoCrafter1', 'VideoCrafter0.9', 'Pika1.0', 'Gen2-09.2023', 'Gen2-12.2023', 'HotShot', 'Lavie-Base', 'Lavie-Interpolation', 'ModelScope', 'MoonValley', 'Show1', 'ZeroScope']:
|
195 |
video_path = f"./{category}/{video_name}" # Updated to use local path
|
196 |
-
video_path = f"./0000.mp4" # Updated to use local path
|
197 |
caption_path = os.path.join('prompts', caption_name)
|
198 |
if os.path.exists(video_path):
|
199 |
caption_text = ""
|
@@ -277,9 +285,6 @@ with gr.Blocks(css=css) as app:
|
|
277 |
gr.Markdown(js)
|
278 |
page_num = gr.State(value=1)
|
279 |
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
with gr.Row():
|
284 |
beginning_button = gr.Button("Beginning")
|
285 |
previous_button = gr.Button("Previous")
|
@@ -288,8 +293,6 @@ with gr.Blocks(css=css) as app:
|
|
288 |
page_slider = gr.Slider(minimum=1, maximum=total_pages, step=1, value=1, label="Go to page")
|
289 |
output_html = gr.HTML()
|
290 |
|
291 |
-
|
292 |
-
|
293 |
def update_output(direction):
|
294 |
# new_page_num = navigate(direction, page_num.value)
|
295 |
if isinstance(direction, int):
|
@@ -305,7 +308,6 @@ with gr.Blocks(css=css) as app:
|
|
305 |
return page_num.value, showcase(page_num.value)
|
306 |
|
307 |
app.load(fn=lambda: initialization('1'), inputs=None, outputs=[page_slider, output_html])
|
308 |
-
|
309 |
|
310 |
beginning_button.click(fn=lambda: update_output("Beginning"), inputs=None, outputs=[page_slider, output_html])
|
311 |
previous_button.click(fn=lambda: update_output("Previous"), inputs=None, outputs=[page_slider, output_html])
|
|
|
3 |
|
4 |
css = """
|
5 |
<style>
|
6 |
+
body, html {
|
7 |
+
margin: 0;
|
8 |
+
padding: 0;
|
9 |
+
font-family: 'Helvetica Neue', Arial, sans-serif;
|
10 |
+
height: 100%;
|
11 |
+
width: 100%;
|
12 |
+
}
|
13 |
+
|
14 |
|
15 |
.gallery-container {
|
16 |
display: flex;
|
|
|
201 |
|
202 |
for category in ['VideoCrafter2', 'Pika', 'VideoCrafter1', 'VideoCrafter0.9', 'Pika1.0', 'Gen2-09.2023', 'Gen2-12.2023', 'HotShot', 'Lavie-Base', 'Lavie-Interpolation', 'ModelScope', 'MoonValley', 'Show1', 'ZeroScope']:
|
203 |
video_path = f"./{category}/{video_name}" # Updated to use local path
|
204 |
+
# video_path = f"./0000.mp4" # Updated to use local path
|
205 |
caption_path = os.path.join('prompts', caption_name)
|
206 |
if os.path.exists(video_path):
|
207 |
caption_text = ""
|
|
|
285 |
gr.Markdown(js)
|
286 |
page_num = gr.State(value=1)
|
287 |
|
|
|
|
|
|
|
288 |
with gr.Row():
|
289 |
beginning_button = gr.Button("Beginning")
|
290 |
previous_button = gr.Button("Previous")
|
|
|
293 |
page_slider = gr.Slider(minimum=1, maximum=total_pages, step=1, value=1, label="Go to page")
|
294 |
output_html = gr.HTML()
|
295 |
|
|
|
|
|
296 |
def update_output(direction):
|
297 |
# new_page_num = navigate(direction, page_num.value)
|
298 |
if isinstance(direction, int):
|
|
|
308 |
return page_num.value, showcase(page_num.value)
|
309 |
|
310 |
app.load(fn=lambda: initialization('1'), inputs=None, outputs=[page_slider, output_html])
|
|
|
311 |
|
312 |
beginning_button.click(fn=lambda: update_output("Beginning"), inputs=None, outputs=[page_slider, output_html])
|
313 |
previous_button.click(fn=lambda: update_output("Previous"), inputs=None, outputs=[page_slider, output_html])
|