Spaces:
Sleeping
Sleeping
Anonymous
commited on
Commit
•
d24f7b8
1
Parent(s):
144c63e
add spaces
Browse files
app.py
CHANGED
@@ -24,6 +24,12 @@ from utils.utils_freetraj import plan_path
|
|
24 |
|
25 |
MAX_KEYS = 5
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
def check_move(trajectory, video_length=16):
|
28 |
traj_len = len(trajectory)
|
29 |
if traj_len < 2:
|
@@ -40,7 +46,7 @@ def check_move(trajectory, video_length=16):
|
|
40 |
|
41 |
return True
|
42 |
|
43 |
-
@spaces.GPU(duration=
|
44 |
def infer(*user_args):
|
45 |
prompt_in = user_args[0]
|
46 |
target_indices = user_args[1]
|
@@ -62,8 +68,6 @@ def infer(*user_args):
|
|
62 |
video_length = 16
|
63 |
width = 512
|
64 |
height = 320
|
65 |
-
ckpt_dir_512 = "checkpoints/base_512_v2"
|
66 |
-
ckpt_path_512 = "checkpoints/base_512_v2/model.ckpt"
|
67 |
if radio_mode == 'ori':
|
68 |
config_512 = "configs/inference_t2v_512_v2.0.yaml"
|
69 |
else:
|
@@ -98,14 +102,7 @@ def infer(*user_args):
|
|
98 |
model_config_512 = config_512.pop("model", OmegaConf.create())
|
99 |
model = instantiate_from_config(model_config_512)
|
100 |
model = model.cuda()
|
101 |
-
|
102 |
-
os.makedirs(ckpt_dir_512, exist_ok=True)
|
103 |
-
hf_hub_download(repo_id="VideoCrafter/VideoCrafter2", filename="model.ckpt", local_dir=ckpt_dir_512)
|
104 |
-
try:
|
105 |
-
model = load_model_checkpoint(model, ckpt_path_512)
|
106 |
-
except:
|
107 |
-
hf_hub_download(repo_id="VideoCrafter/VideoCrafter2", filename="model.ckpt", local_dir=ckpt_dir_512, force_download=True)
|
108 |
-
model = load_model_checkpoint(model, ckpt_path_512)
|
109 |
model.eval()
|
110 |
|
111 |
if seed is None:
|
|
|
24 |
|
25 |
MAX_KEYS = 5
|
26 |
|
27 |
+
ckpt_dir_512 = "checkpoints/base_512_v2"
|
28 |
+
ckpt_path_512 = "checkpoints/base_512_v2/model.ckpt"
|
29 |
+
if not os.path.exists(ckpt_path_512):
|
30 |
+
os.makedirs(ckpt_dir_512, exist_ok=True)
|
31 |
+
hf_hub_download(repo_id="VideoCrafter/VideoCrafter2", filename="model.ckpt", local_dir=ckpt_dir_512, force_download=True)
|
32 |
+
|
33 |
def check_move(trajectory, video_length=16):
|
34 |
traj_len = len(trajectory)
|
35 |
if traj_len < 2:
|
|
|
46 |
|
47 |
return True
|
48 |
|
49 |
+
@spaces.GPU(duration=180)
|
50 |
def infer(*user_args):
|
51 |
prompt_in = user_args[0]
|
52 |
target_indices = user_args[1]
|
|
|
68 |
video_length = 16
|
69 |
width = 512
|
70 |
height = 320
|
|
|
|
|
71 |
if radio_mode == 'ori':
|
72 |
config_512 = "configs/inference_t2v_512_v2.0.yaml"
|
73 |
else:
|
|
|
102 |
model_config_512 = config_512.pop("model", OmegaConf.create())
|
103 |
model = instantiate_from_config(model_config_512)
|
104 |
model = model.cuda()
|
105 |
+
model = load_model_checkpoint(model, ckpt_path_512)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
model.eval()
|
107 |
|
108 |
if seed is None:
|