Upload 2 files
Browse files- inference_512_v1.0_09B.yaml +105 -0
- run_hummingbird.sh +51 -0
inference_512_v1.0_09B.yaml
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model:
|
| 2 |
+
target: lvdm.models.ddpm3d.LatentVisualDiffusion
|
| 3 |
+
params:
|
| 4 |
+
#rescale_betas_zero_snr: True
|
| 5 |
+
rescale_betas_zero_snr: False
|
| 6 |
+
parameterization: "v"
|
| 7 |
+
#parameterization: "eps"
|
| 8 |
+
linear_start: 0.00085
|
| 9 |
+
linear_end: 0.012
|
| 10 |
+
num_timesteps_cond: 1
|
| 11 |
+
timesteps: 1000
|
| 12 |
+
first_stage_key: video
|
| 13 |
+
cond_stage_key: caption
|
| 14 |
+
cond_stage_trainable: False
|
| 15 |
+
conditioning_key: hybrid
|
| 16 |
+
image_size: [40, 64]
|
| 17 |
+
channels: 4
|
| 18 |
+
scale_by_std: False
|
| 19 |
+
scale_factor: 0.18215
|
| 20 |
+
use_ema: False
|
| 21 |
+
uncond_type: 'empty_seq'
|
| 22 |
+
use_dynamic_rescale: true
|
| 23 |
+
base_scale: 0.7
|
| 24 |
+
fps_condition_type: 'fps'
|
| 25 |
+
perframe_ae: True
|
| 26 |
+
unet_config:
|
| 27 |
+
target: lvdm.modules.networks.openaimodel3d.UNetModel
|
| 28 |
+
params:
|
| 29 |
+
in_channels: 8
|
| 30 |
+
out_channels: 4
|
| 31 |
+
model_channels: 320
|
| 32 |
+
attention_resolutions:
|
| 33 |
+
- 4
|
| 34 |
+
- 2
|
| 35 |
+
- 1
|
| 36 |
+
num_res_blocks: 1
|
| 37 |
+
channel_mult:
|
| 38 |
+
- 1
|
| 39 |
+
- 2
|
| 40 |
+
- 4
|
| 41 |
+
- 4
|
| 42 |
+
dropout: 0.1
|
| 43 |
+
num_head_channels: 64
|
| 44 |
+
transformer_depth: 1
|
| 45 |
+
context_dim: 1024
|
| 46 |
+
use_linear: true
|
| 47 |
+
use_checkpoint: True
|
| 48 |
+
temporal_conv: True
|
| 49 |
+
temporal_attention: True
|
| 50 |
+
temporal_selfatt_only: true
|
| 51 |
+
use_relative_position: false
|
| 52 |
+
use_causal_attention: False
|
| 53 |
+
temporal_length: 16
|
| 54 |
+
addition_attention: true
|
| 55 |
+
image_cross_attention: true
|
| 56 |
+
default_fs: 24
|
| 57 |
+
fs_condition: true
|
| 58 |
+
|
| 59 |
+
first_stage_config:
|
| 60 |
+
target: lvdm.models.autoencoder.AutoencoderKL
|
| 61 |
+
params:
|
| 62 |
+
embed_dim: 4
|
| 63 |
+
monitor: val/rec_loss
|
| 64 |
+
ddconfig:
|
| 65 |
+
double_z: True
|
| 66 |
+
z_channels: 4
|
| 67 |
+
resolution: 256
|
| 68 |
+
in_channels: 3
|
| 69 |
+
out_ch: 3
|
| 70 |
+
ch: 128
|
| 71 |
+
ch_mult:
|
| 72 |
+
- 1
|
| 73 |
+
- 2
|
| 74 |
+
- 4
|
| 75 |
+
- 4
|
| 76 |
+
num_res_blocks: 2
|
| 77 |
+
attn_resolutions: []
|
| 78 |
+
dropout: 0.0
|
| 79 |
+
lossconfig:
|
| 80 |
+
target: torch.nn.Identity
|
| 81 |
+
|
| 82 |
+
cond_stage_config:
|
| 83 |
+
target: lvdm.modules.encoders.condition.FrozenOpenCLIPEmbedder
|
| 84 |
+
params:
|
| 85 |
+
freeze: true
|
| 86 |
+
layer: "penultimate"
|
| 87 |
+
|
| 88 |
+
img_cond_stage_config:
|
| 89 |
+
target: lvdm.modules.encoders.condition.FrozenOpenCLIPImageEmbedderV2
|
| 90 |
+
params:
|
| 91 |
+
freeze: true
|
| 92 |
+
|
| 93 |
+
image_proj_stage_config:
|
| 94 |
+
target: lvdm.modules.encoders.resampler.Resampler
|
| 95 |
+
params:
|
| 96 |
+
dim: 1024
|
| 97 |
+
depth: 4
|
| 98 |
+
dim_head: 64
|
| 99 |
+
heads: 12
|
| 100 |
+
num_queries: 16
|
| 101 |
+
embedding_dim: 1280
|
| 102 |
+
output_dim: 1024
|
| 103 |
+
ff_mult: 4
|
| 104 |
+
video_length: 16
|
| 105 |
+
|
run_hummingbird.sh
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version=$1 ## 1024, 512, 256
|
| 2 |
+
GPU=3
|
| 3 |
+
ckpt='./stage_1.ckpt'
|
| 4 |
+
config='configs/inference_512_v1.0_09B.yaml'
|
| 5 |
+
prompt_dir="/VBench"
|
| 6 |
+
base_res_dir="result"
|
| 7 |
+
|
| 8 |
+
# 判断分辨率
|
| 9 |
+
if [ "$1" == "256" ]; then
|
| 10 |
+
H=256
|
| 11 |
+
FS=3
|
| 12 |
+
elif [ "$1" == "512" ]; then
|
| 13 |
+
H=320
|
| 14 |
+
FS=24
|
| 15 |
+
elif [ "$1" == "1024" ]; then
|
| 16 |
+
H=576
|
| 17 |
+
FS=10
|
| 18 |
+
else
|
| 19 |
+
echo "Invalid input. Please enter 256, 512, or 1024."
|
| 20 |
+
exit 1
|
| 21 |
+
fi
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
seed='123'
|
| 25 |
+
sub_dir='0'
|
| 26 |
+
res_dir="${base_res_dir}/${sub_dir}"
|
| 27 |
+
|
| 28 |
+
echo "Running seed=$seed -> Saving to: $res_dir"
|
| 29 |
+
echo $prompt_dir
|
| 30 |
+
|
| 31 |
+
CUDA_VISIBLE_DEVICES=$GPU python3 scripts/evaluation/inference.py \
|
| 32 |
+
--seed ${seed} \
|
| 33 |
+
--ckpt_path $ckpt \
|
| 34 |
+
--config $config \
|
| 35 |
+
--savedir $res_dir \
|
| 36 |
+
--n_samples 1 \
|
| 37 |
+
--bs 1 --height ${H} --width $1 \
|
| 38 |
+
--unconditional_guidance_scale 7.5 \
|
| 39 |
+
--ddim_steps 16 \
|
| 40 |
+
--ddim_eta 1.0 \
|
| 41 |
+
--prompt_dir $prompt_dir \
|
| 42 |
+
--text_input \
|
| 43 |
+
--video_length 16 \
|
| 44 |
+
--frame_stride ${FS} \
|
| 45 |
+
--use_unet 1 \
|
| 46 |
+
--unet_path 'stae_2/output/unet.pt' \
|
| 47 |
+
--img_proj_path 'stage_2/output/img_proj.pt' \
|
| 48 |
+
--timestep_spacing 'uniform_trailing' \
|
| 49 |
+
--guidance_rescale 0.7 \
|
| 50 |
+
--perframe_ae
|
| 51 |
+
|