|
|
import yaml |
|
|
import os |
|
|
|
|
|
file_pairs_file = "./dataset/ViViD/upper_body/test_pairs.txt" |
|
|
output_yaml_path = "./configs/prompts/upper_body2.yaml" |
|
|
videos_dir = "./dataset/ViViD/upper_body/videos" |
|
|
images_dir = "./dataset/ViViD/upper_body/images" |
|
|
|
|
|
yaml_data = { |
|
|
"pretrained_base_model_path": "ckpts/sd-image-variations-diffusers", |
|
|
"pretrained_vae_path": "ckpts/sd-vae-ft-mse", |
|
|
"image_encoder_path": "ckpts/sd-image-variations-diffusers/image_encoder", |
|
|
"denoising_unet_path": "ckpts/ViViD/denoising_unet.pth", |
|
|
"reference_unet_path": "ckpts/ViViD/reference_unet.pth", |
|
|
"pose_guider_path": "ckpts/ViViD/pose_guider.pth", |
|
|
"motion_module_path": "ckpts/MotionModule/mm_sd_v15_v2.ckpt", |
|
|
"inference_config": "./configs/inference/inference.yaml", |
|
|
"weight_dtype": "fp16", |
|
|
"model_video_paths": [], |
|
|
"cloth_image_paths": [] |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
with open(file_pairs_file, 'r') as file: |
|
|
for line in file: |
|
|
|
|
|
video_file_name, image_file_name = line.strip().split() |
|
|
|
|
|
video_path = os.path.join(videos_dir, video_file_name) |
|
|
image_path = os.path.join(images_dir, image_file_name) |
|
|
yaml_data["model_video_paths"].append(video_path) |
|
|
yaml_data["cloth_image_paths"].append(image_path) |
|
|
|
|
|
|
|
|
with open(output_yaml_path, 'w') as yaml_file: |
|
|
yaml.dump(yaml_data, yaml_file, default_flow_style=False) |
|
|
|
|
|
print(f"YAML 文件已生成: {output_yaml_path}") |