| import os |
| import random |
| import subprocess |
| import time |
|
|
| src_root = "/share_zhuyixuan05/zhuyixuan05/spatialvid" |
| dst_root = "/share_zhuyixuan05/zhuyixuan05/New_spatialvid_drone_first" |
| infer_script = "/home/zhuyixuan05/ReCamMaster/infer_origin.py" |
|
|
| while True: |
| |
| subdirs = [d for d in os.listdir(src_root) if os.path.isdir(os.path.join(src_root, d))] |
| if not subdirs: |
| print("没有可用的子文件夹") |
| break |
| chosen = random.choice(subdirs) |
| chosen_dir = os.path.join(src_root, chosen) |
| pth_file = os.path.join(chosen_dir, "encoded_video.pth") |
| if not os.path.exists(pth_file): |
| print(f"{pth_file} 不存在,跳过") |
| continue |
|
|
| |
| out_file = os.path.join(dst_root, f"{chosen}.mp4") |
| print(f"开始生成: {pth_file} -> {out_file}") |
|
|
| |
| cmd = [ |
| "python", infer_script, |
| "--condition_pth", pth_file, |
| "--output_path", out_file, |
| "--prompt", "exploring the world", |
| "--modality_type", "sekai", |
| "--direction", "right", |
| "--dit_path", "/share_zhuyixuan05/zhuyixuan05/ICLR2026/framepack_moe/step25000_first.ckpt", |
| "--use_gt_prompt" |
| ] |
|
|
| |
| env = os.environ.copy() |
| env["CUDA_VISIBLE_DEVICES"] = "0" |
|
|
| |
| subprocess.run(cmd, env=env) |