Spaces:
Runtime error
Runtime error
second test
Browse files
app.py
CHANGED
@@ -15,9 +15,8 @@ import math
|
|
15 |
import requests
|
16 |
|
17 |
|
18 |
-
basedir = "/
|
19 |
-
|
20 |
-
vidOut = "results/10videos"
|
21 |
uvqOut = "results/modified_prompts_eval"
|
22 |
evalOut = "evaluation_results"
|
23 |
num_of_vid = 3
|
@@ -100,11 +99,11 @@ def VBench_eval(vid_filename):
|
|
100 |
|
101 |
def interpolation(chosen_idx, fps):
|
102 |
vid_filename = f"{chosen_idx:04d}.mp4"
|
103 |
-
os.chdir("/
|
104 |
os.system(
|
105 |
f'python3 inference_video.py --exp=2 --video={os.path.join(basedir, vidOut, vid_filename)} --fps {fps}'
|
106 |
)
|
107 |
-
os.chdir("
|
108 |
out_name = f"{chosen_idx:04d}_4X_{fps}fps.mp4"
|
109 |
return out_name
|
110 |
|
@@ -210,7 +209,6 @@ def generate_output(input_text, output_video_1, fps, examples):
|
|
210 |
chosen_idx = chooseBestVideo()
|
211 |
chosen_vid_path = interpolation(chosen_idx, fps)
|
212 |
chosen_vid_path = f"{basedir}/{vidOut}/{chosen_vid_path}"
|
213 |
-
# chosen_vid_path = "/content/drive/MyDrive/FYP/Code/VideoCrafter/results/cat/0002_4X_16fps.mp4"
|
214 |
output_video_1 = gr.Video(
|
215 |
value=chosen_vid_path, show_download_button=True)
|
216 |
|
@@ -280,7 +278,7 @@ def t2v_demo(result_dir='./tmp/'):
|
|
280 |
with gr.Tab(label='Result'):
|
281 |
with gr.Row():
|
282 |
output_video_1 = gr.Video(
|
283 |
-
value="/
|
284 |
|
285 |
video_len.change(update_fps, inputs=[video_len, fps], outputs=fps)
|
286 |
# fps.change(update_video_len_slider, inputs = fps, outputs = video_len)
|
|
|
15 |
import requests
|
16 |
|
17 |
|
18 |
+
basedir = "https://huggingface.co/spaces/ychenhq/VideoCrafterXen"
|
19 |
+
vidOut = "results/results"
|
|
|
20 |
uvqOut = "results/modified_prompts_eval"
|
21 |
evalOut = "evaluation_results"
|
22 |
num_of_vid = 3
|
|
|
99 |
|
100 |
def interpolation(chosen_idx, fps):
|
101 |
vid_filename = f"{chosen_idx:04d}.mp4"
|
102 |
+
os.chdir(f"{basedir}/ECCV2022-RIFE")
|
103 |
os.system(
|
104 |
f'python3 inference_video.py --exp=2 --video={os.path.join(basedir, vidOut, vid_filename)} --fps {fps}'
|
105 |
)
|
106 |
+
os.chdir(f"{basedir}")
|
107 |
out_name = f"{chosen_idx:04d}_4X_{fps}fps.mp4"
|
108 |
return out_name
|
109 |
|
|
|
209 |
chosen_idx = chooseBestVideo()
|
210 |
chosen_vid_path = interpolation(chosen_idx, fps)
|
211 |
chosen_vid_path = f"{basedir}/{vidOut}/{chosen_vid_path}"
|
|
|
212 |
output_video_1 = gr.Video(
|
213 |
value=chosen_vid_path, show_download_button=True)
|
214 |
|
|
|
278 |
with gr.Tab(label='Result'):
|
279 |
with gr.Row():
|
280 |
output_video_1 = gr.Video(
|
281 |
+
value=f"{basedir}/sample/0009.mp4", show_download_button=True)
|
282 |
|
283 |
video_len.change(update_fps, inputs=[video_len, fps], outputs=fps)
|
284 |
# fps.change(update_video_len_slider, inputs = fps, outputs = video_len)
|