Download runs/inference_episode.diff from BlueSourceJY/ERCBench-ShotStream-400: direct link, hf CLI and curl.
- Browser
- Download file 1.64 kB
-
https://huggingface.co/datasets/BlueSourceJY/ERCBench-ShotStream-400/resolve/main/runs/inference_episode.diff
- Command line
-
hf download hf://datasets/BlueSourceJY/ERCBench-ShotStream-400/runs/inference_episode.diff
-
curl -L -o inference_episode.diff https://huggingface.co/datasets/BlueSourceJY/ERCBench-ShotStream-400/resolve/main/runs/inference_episode.diff
1.64 kB
| --- Inference_Causal.py 2026-11-15 21:30:09.717290004 +0000 | |
| +++ inference_episode.py 2026-11-15 21:31:57.654121478 +0000 | |
| for i, batch_data in tqdm(enumerate(dataloader), disable=(local_rank != 0)): | |
| idx = batch_data['idx'].item() | |
| + # [MOD 1] output name from CSV episode_id | |
| + import pandas as _pd | |
| + if i == 0: | |
| + _meta = _pd.read_csv(config.data_path) | |
| + episode_id = str(_meta["episode_id"][idx]) | |
| + output_path = f"{args.output_folder}/{episode_id}.mp4" | |
| + # [MOD 3] skip if output exists with correct frame count (81 per shot) | |
| + if os.path.exists(output_path): | |
| + import subprocess as _sp | |
| + _expected = 81 * int(_meta["shot_num_from_caption"][idx]) | |
| + _n = _sp.run(["ffprobe", "-v", "error", "-count_frames", "-select_streams", "v:0", "-show_entries", | |
| + "stream=nb_read_frames", "-of", "csv=p=0", output_path], capture_output=True, text=True).stdout.strip() | |
| + if _n == str(_expected): | |
| + print(f"[EPISODE] skip {episode_id} (exists, {_n} frames)", flush=True) | |
| + continue | |
| + # [MOD 2] per-episode seed | |
| + set_seed(args.seed) | |
| + print(f"[EPISODE] start {episode_id} seed={args.seed}", flush=True) | |
| + | |
| if isinstance(batch_data, dict): | |
| batch = batch_data | |
| elif isinstance(batch_data, list): | |
| pipeline.vae.model.clear_cache() | |
| - caption=batch['shots_captions'][0][-1][0][0] | |
| - output_path = f"{args.output_folder}/{i:03d}_{caption[:50]}.mp4" | |
| write_video(output_path, video[0], fps=16) | |
| + print(f"[EPISODE] saved {episode_id} -> {output_path}", flush=True) | |