Spaces:
Runtime error
Runtime error
encounter1997
commited on
Commit
Β·
200e6b9
1
Parent(s):
4fed504
add float16
Browse files- configs/black-swan.yaml +1 -1
- configs/brown-bear.yaml +1 -1
- configs/car-moving.yaml +1 -1
- configs/car-turn.yaml +1 -1
- configs/child-riding.yaml +1 -1
- configs/cow-walking.yaml +1 -1
- configs/dog-walking.yaml +1 -1
- configs/horse-running.yaml +1 -1
- configs/lion-roaring.yaml +1 -1
- configs/man-running.yaml +1 -1
- configs/man-surfing.yaml +1 -1
- configs/rabbit-watermelon.yaml +1 -1
- configs/skateboard-dog.yaml +1 -1
- configs/skateboard-man.yaml +1 -1
- test_vid2vid_zero.py +6 -5
- vid2vid_zero/util.py +1 -1
configs/black-swan.yaml
CHANGED
@@ -27,7 +27,7 @@ validation_data:
|
|
27 |
|
28 |
input_batch_size: 1
|
29 |
seed: 33
|
30 |
-
mixed_precision: "
|
31 |
gradient_checkpointing: True
|
32 |
enable_xformers_memory_efficient_attention: True
|
33 |
# test-time adaptation
|
|
|
27 |
|
28 |
input_batch_size: 1
|
29 |
seed: 33
|
30 |
+
mixed_precision: "fp16"
|
31 |
gradient_checkpointing: True
|
32 |
enable_xformers_memory_efficient_attention: True
|
33 |
# test-time adaptation
|
configs/brown-bear.yaml
CHANGED
@@ -28,7 +28,7 @@ validation_data:
|
|
28 |
|
29 |
input_batch_size: 1
|
30 |
seed: 33
|
31 |
-
mixed_precision: "
|
32 |
gradient_checkpointing: True
|
33 |
enable_xformers_memory_efficient_attention: True
|
34 |
# test-time adaptation
|
|
|
28 |
|
29 |
input_batch_size: 1
|
30 |
seed: 33
|
31 |
+
mixed_precision: "fp16"
|
32 |
gradient_checkpointing: True
|
33 |
enable_xformers_memory_efficient_attention: True
|
34 |
# test-time adaptation
|
configs/car-moving.yaml
CHANGED
@@ -28,7 +28,7 @@ validation_data:
|
|
28 |
|
29 |
input_batch_size: 1
|
30 |
seed: 33
|
31 |
-
mixed_precision: "
|
32 |
gradient_checkpointing: True
|
33 |
enable_xformers_memory_efficient_attention: True
|
34 |
# test-time adaptation
|
|
|
28 |
|
29 |
input_batch_size: 1
|
30 |
seed: 33
|
31 |
+
mixed_precision: "fp16"
|
32 |
gradient_checkpointing: True
|
33 |
enable_xformers_memory_efficient_attention: True
|
34 |
# test-time adaptation
|
configs/car-turn.yaml
CHANGED
@@ -30,7 +30,7 @@ validation_data:
|
|
30 |
|
31 |
input_batch_size: 1
|
32 |
seed: 33
|
33 |
-
mixed_precision: "
|
34 |
gradient_checkpointing: True
|
35 |
enable_xformers_memory_efficient_attention: True
|
36 |
# test-time adaptation
|
|
|
30 |
|
31 |
input_batch_size: 1
|
32 |
seed: 33
|
33 |
+
mixed_precision: "fp16"
|
34 |
gradient_checkpointing: True
|
35 |
enable_xformers_memory_efficient_attention: True
|
36 |
# test-time adaptation
|
configs/child-riding.yaml
CHANGED
@@ -31,7 +31,7 @@ validation_data:
|
|
31 |
|
32 |
input_batch_size: 1
|
33 |
seed: 33
|
34 |
-
mixed_precision: "
|
35 |
gradient_checkpointing: True
|
36 |
enable_xformers_memory_efficient_attention: True
|
37 |
# test-time adaptation
|
|
|
31 |
|
32 |
input_batch_size: 1
|
33 |
seed: 33
|
34 |
+
mixed_precision: "fp16"
|
35 |
gradient_checkpointing: True
|
36 |
enable_xformers_memory_efficient_attention: True
|
37 |
# test-time adaptation
|
configs/cow-walking.yaml
CHANGED
@@ -28,7 +28,7 @@ validation_data:
|
|
28 |
|
29 |
input_batch_size: 1
|
30 |
seed: 33
|
31 |
-
mixed_precision: "
|
32 |
gradient_checkpointing: True
|
33 |
enable_xformers_memory_efficient_attention: True
|
34 |
# test-time adaptation
|
|
|
28 |
|
29 |
input_batch_size: 1
|
30 |
seed: 33
|
31 |
+
mixed_precision: "fp16"
|
32 |
gradient_checkpointing: True
|
33 |
enable_xformers_memory_efficient_attention: True
|
34 |
# test-time adaptation
|
configs/dog-walking.yaml
CHANGED
@@ -26,7 +26,7 @@ validation_data:
|
|
26 |
|
27 |
input_batch_size: 1
|
28 |
seed: 33
|
29 |
-
mixed_precision: "
|
30 |
gradient_checkpointing: True
|
31 |
enable_xformers_memory_efficient_attention: True
|
32 |
# test-time adaptation
|
|
|
26 |
|
27 |
input_batch_size: 1
|
28 |
seed: 33
|
29 |
+
mixed_precision: "fp16"
|
30 |
gradient_checkpointing: True
|
31 |
enable_xformers_memory_efficient_attention: True
|
32 |
# test-time adaptation
|
configs/horse-running.yaml
CHANGED
@@ -27,7 +27,7 @@ validation_data:
|
|
27 |
|
28 |
input_batch_size: 1
|
29 |
seed: 33
|
30 |
-
mixed_precision: "
|
31 |
gradient_checkpointing: True
|
32 |
enable_xformers_memory_efficient_attention: True
|
33 |
# test-time adaptation
|
|
|
27 |
|
28 |
input_batch_size: 1
|
29 |
seed: 33
|
30 |
+
mixed_precision: "fp16"
|
31 |
gradient_checkpointing: True
|
32 |
enable_xformers_memory_efficient_attention: True
|
33 |
# test-time adaptation
|
configs/lion-roaring.yaml
CHANGED
@@ -28,7 +28,7 @@ validation_data:
|
|
28 |
|
29 |
input_batch_size: 1
|
30 |
seed: 33
|
31 |
-
mixed_precision: "
|
32 |
gradient_checkpointing: True
|
33 |
enable_xformers_memory_efficient_attention: True
|
34 |
# test-time adaptation
|
|
|
28 |
|
29 |
input_batch_size: 1
|
30 |
seed: 33
|
31 |
+
mixed_precision: "fp16"
|
32 |
gradient_checkpointing: True
|
33 |
enable_xformers_memory_efficient_attention: True
|
34 |
# test-time adaptation
|
configs/man-running.yaml
CHANGED
@@ -28,7 +28,7 @@ validation_data:
|
|
28 |
|
29 |
input_batch_size: 1
|
30 |
seed: 33
|
31 |
-
mixed_precision: "
|
32 |
gradient_checkpointing: True
|
33 |
enable_xformers_memory_efficient_attention: True
|
34 |
# test-time adaptation
|
|
|
28 |
|
29 |
input_batch_size: 1
|
30 |
seed: 33
|
31 |
+
mixed_precision: "fp16"
|
32 |
gradient_checkpointing: True
|
33 |
enable_xformers_memory_efficient_attention: True
|
34 |
# test-time adaptation
|
configs/man-surfing.yaml
CHANGED
@@ -27,7 +27,7 @@ validation_data:
|
|
27 |
|
28 |
input_batch_size: 1
|
29 |
seed: 33
|
30 |
-
mixed_precision: "
|
31 |
gradient_checkpointing: True
|
32 |
enable_xformers_memory_efficient_attention: True
|
33 |
# test-time adaptation
|
|
|
27 |
|
28 |
input_batch_size: 1
|
29 |
seed: 33
|
30 |
+
mixed_precision: "fp16"
|
31 |
gradient_checkpointing: True
|
32 |
enable_xformers_memory_efficient_attention: True
|
33 |
# test-time adaptation
|
configs/rabbit-watermelon.yaml
CHANGED
@@ -31,7 +31,7 @@ validation_data:
|
|
31 |
|
32 |
input_batch_size: 1
|
33 |
seed: 33
|
34 |
-
mixed_precision: "
|
35 |
gradient_checkpointing: True
|
36 |
enable_xformers_memory_efficient_attention: True
|
37 |
# test-time adaptation
|
|
|
31 |
|
32 |
input_batch_size: 1
|
33 |
seed: 33
|
34 |
+
mixed_precision: "fp16"
|
35 |
gradient_checkpointing: True
|
36 |
enable_xformers_memory_efficient_attention: True
|
37 |
# test-time adaptation
|
configs/skateboard-dog.yaml
CHANGED
@@ -26,7 +26,7 @@ validation_data:
|
|
26 |
|
27 |
input_batch_size: 1
|
28 |
seed: 33
|
29 |
-
mixed_precision: "
|
30 |
gradient_checkpointing: True
|
31 |
enable_xformers_memory_efficient_attention: True
|
32 |
# test-time adaptation
|
|
|
26 |
|
27 |
input_batch_size: 1
|
28 |
seed: 33
|
29 |
+
mixed_precision: "fp16"
|
30 |
gradient_checkpointing: True
|
31 |
enable_xformers_memory_efficient_attention: True
|
32 |
# test-time adaptation
|
configs/skateboard-man.yaml
CHANGED
@@ -26,7 +26,7 @@ validation_data:
|
|
26 |
|
27 |
input_batch_size: 1
|
28 |
seed: 33
|
29 |
-
mixed_precision: "
|
30 |
gradient_checkpointing: True
|
31 |
enable_xformers_memory_efficient_attention: True
|
32 |
# test-time adaptation
|
|
|
26 |
|
27 |
input_batch_size: 1
|
28 |
seed: 33
|
29 |
+
mixed_precision: "fp16"
|
30 |
gradient_checkpointing: True
|
31 |
enable_xformers_memory_efficient_attention: True
|
32 |
# test-time adaptation
|
test_vid2vid_zero.py
CHANGED
@@ -221,11 +221,12 @@ def main(
|
|
221 |
model=validation_pipeline, guidance_scale=validation_data.guidance_scale, null_inv_with_prompt=False,
|
222 |
null_normal_infer=validation_data.null_normal_infer,
|
223 |
)
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
|
|
229 |
ddim_inv_latent = ddim_inv_latent.to(weight_dtype)
|
230 |
uncond_embeddings = [embed.to(weight_dtype) for embed in uncond_embeddings]
|
231 |
else:
|
|
|
221 |
model=validation_pipeline, guidance_scale=validation_data.guidance_scale, null_inv_with_prompt=False,
|
222 |
null_normal_infer=validation_data.null_normal_infer,
|
223 |
)
|
224 |
+
with torch.cuda.amp.autocast(enabled=True, dtype=torch.float32):
|
225 |
+
ddim_inv_latent, uncond_embeddings = null_inversion.invert(
|
226 |
+
latents, input_dataset.prompt, verbose=True,
|
227 |
+
null_inner_steps=validation_data.null_inner_steps,
|
228 |
+
null_base_lr=validation_data.null_base_lr,
|
229 |
+
)
|
230 |
ddim_inv_latent = ddim_inv_latent.to(weight_dtype)
|
231 |
uncond_embeddings = [embed.to(weight_dtype) for embed in uncond_embeddings]
|
232 |
else:
|
vid2vid_zero/util.py
CHANGED
@@ -42,7 +42,7 @@ def save_videos_grid(videos: torch.Tensor, path: str, rescale=False, n_rows=4, f
|
|
42 |
outputs.append(x)
|
43 |
|
44 |
os.makedirs(os.path.dirname(path), exist_ok=True)
|
45 |
-
imageio.mimsave(path, outputs, fps=
|
46 |
|
47 |
# save for gradio demo
|
48 |
out_file = tempfile.NamedTemporaryFile(suffix='.mp4', delete=False)
|
|
|
42 |
outputs.append(x)
|
43 |
|
44 |
os.makedirs(os.path.dirname(path), exist_ok=True)
|
45 |
+
imageio.mimsave(path, outputs, fps=8)
|
46 |
|
47 |
# save for gradio demo
|
48 |
out_file = tempfile.NamedTemporaryFile(suffix='.mp4', delete=False)
|