YFanwang commited on
Commit
cbd980e
·
verified ·
1 Parent(s): 3f8d105

Upload VideoX-Fun/cherrypick files batch (10)

Browse files
VideoX-Fun/cherrypick/00000020.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:851afa24c11bfd4d93ec5fed01149655836f7ef425fe95724f0f84a38a517e4a
3
+ size 236620
VideoX-Fun/cherrypick/00000048.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8e7e92b3fbb92e033e4ca4d925c9c2295ed4a7fe32d5c1ec49e25e26cea9992
3
+ size 263729
VideoX-Fun/cherrypick/Nov2_1_2000_00000048.gif ADDED

Git LFS Details

  • SHA256: 34ba722d639b32850fb886fdd5427c8cabe8a8bf5f9ae6d84b81d42b0b96ea66
  • Pointer size: 131 Bytes
  • Size of remote file: 943 kB
VideoX-Fun/cherrypick/collect_videos.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import os
3
+
4
+ import shutil
5
+
6
+ src = "human_eval_set.json"
7
+ dst = "/root/human_eval/human_eval_set.json"
8
+ os.makedirs(os.path.dirname(dst), exist_ok=True)
9
+
10
+ shutil.copy2(src, dst)
11
+
12
+
13
+ with open('human_eval_set.json', 'r') as f:
14
+ data = json.load(f)
15
+
16
+ for key in data.keys():
17
+
18
+ src1 = f'/s3-code/ywang29/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/{key}.mp4'
19
+ src2 = f'/s3-code/ywang29/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_1000/{key}.mp4'
20
+ if '00000001' in key:
21
+ src2 = f'/s3-code/ywang29/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_2500/{key}.mp4'
22
+
23
+ dst1 = f'/root/human_eval/folder1/{key}.mp4'
24
+ dst2 = f'/root/human_eval/folder2/{key}.mp4'
25
+
26
+ os.makedirs(os.path.dirname(dst1), exist_ok=True)
27
+ os.makedirs(os.path.dirname(dst2), exist_ok=True)
28
+
29
+ shutil.copy2(src1, dst1)
30
+ shutil.copy2(src2, dst2)
VideoX-Fun/cherrypick/extract_frames.py ADDED
@@ -0,0 +1,433 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import numpy as np
3
+ from decord import VideoReader, cpu
4
+ from PIL import Image
5
+ import re
6
+ import shutil # 导入 shutil 模块用于文件复制
7
+
8
+ def get_output_path(file_path, sub_folder=None):
9
+ # 保持不变...
10
+ regex = r"output_(.*?)/steps_(\d+)/(\d+)\.mp4$"
11
+ regex = r"(.*?)/(\d+)\.mp4$"
12
+ # ... (其余 get_output_path 保持不变)
13
+ root = file_path
14
+ match = re.search(regex, file_path)
15
+
16
+ if sub_folder:
17
+ base_root = f'/nfs/ywang29/Reward_finetuning/VideoX-Fun/cherrypick/{sub_folder}'
18
+ else:
19
+ base_root = f'/nfs/ywang29/Reward_finetuning/VideoX-Fun/cherrypick'
20
+
21
+ if match:
22
+ segment_1 = match.group(1)
23
+ segment_2 = match.group(2)
24
+ segment_3 = match.group(3)
25
+
26
+ print(f"原始路径: {file_path}")
27
+ print(f"1. 日期/版本段 (output_): {segment_1}")
28
+ print(f"2. 步数段 (steps_): {segment_2}")
29
+ print(f"3. 文件名序号: {segment_3}")
30
+
31
+ return f'{base_root}/{segment_1}_{segment_2}_{segment_3}' # 确保返回一个完整的路径名
32
+
33
+ else:
34
+ # 如果未匹配,我们仍然需要一个有效的路径名来保存文件,
35
+ # 否则后续代码会失败。这里使用视频文件名作为默认输出路径。
36
+ base_name = os.path.basename(file_path).rsplit('.', 1)[0]
37
+ print(f"未找到匹配项,使用默认路径前缀: {base_name}")
38
+ if 'flow_grpo' in file_path:
39
+ import pdb
40
+ # pdb.set_trace()
41
+ steps = root.split('/')[-3].split('_')[-1]
42
+ return f'{base_root}/{base_name}_fg_{steps}'
43
+ else:
44
+ return f'{base_root}/{base_name}_default'
45
+
46
+ def get_eccv_single_supp_video_path(video_path, base_dir=None):
47
+ """
48
+ 将如下输入路径:
49
+ /nfs/ywang29/Reward_finetuning/VideoX-Fun/output_xxx/{video_id}/train_sample_full/{video_name}.mp4
50
+ 映射为:
51
+ ECCV_single_supp/{video_id}/{video_name}.mp4
52
+ """
53
+ normalized_path = os.path.normpath(video_path).replace("\\", "/")
54
+ # 支持 output_single / output_sd_single / output_sd_single_pickscore / output_sd_single_videoalign 等
55
+ match = re.search(r"/output[^/]+/([^/]+)/train_sample_full/([^/]+\.mp4)$", normalized_path)
56
+
57
+ if not match:
58
+ raise ValueError(
59
+ "video_path must follow "
60
+ "'.../output*/{video_id}/train_sample_full/{video_name}.mp4'"
61
+ )
62
+
63
+ video_id = match.group(1)
64
+ video_name = match.group(2)
65
+
66
+ if base_dir is None:
67
+ project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
68
+ base_dir = os.path.join(project_root, "ECCV_single_supp")
69
+
70
+ save_dir = os.path.join(base_dir, video_id)
71
+ os.makedirs(save_dir, exist_ok=True)
72
+ return os.path.join(save_dir, video_name)
73
+
74
+
75
+ def extract_evenly_spaced_frames_decord(video_path, output_dir, num_frames_to_extract=10):
76
+ """
77
+ 使用 Decord 高效地均匀提取视频中的指定数量的帧并保存,并将原始视频复制到输出目录。
78
+
79
+ Args:
80
+ video_path (str): 输入视频文件的完整路径。
81
+ output_dir (str): 保存输出帧和原始视频的目录。
82
+ num_frames_to_extract (int): 需要提取的帧数(默认为 10)。
83
+ """
84
+ if not os.path.exists(video_path):
85
+ print(f"错误:视频文件 '{video_path}' 不存在。")
86
+ return
87
+
88
+ # 1. 初始化 VideoReader
89
+ try:
90
+ vr = VideoReader(video_path, ctx=cpu(0))
91
+ except Exception as e:
92
+ print(f"错误:无法初始化 VideoReader。请检查 FFmpeg 是否安装正确以及视频文件是否损坏。详细错误: {e}")
93
+ return
94
+
95
+ # 2. 获取视频总帧数 & 计算均匀分布的帧索引 (保持不变)
96
+ total_frames = len(vr)
97
+ # ... (省略中间帧计算和检查代码,与原代码一致) ...
98
+ if total_frames < num_frames_to_extract:
99
+ num_frames_to_extract = total_frames
100
+ indices = np.linspace(0, total_frames - 1, num_frames_to_extract, endpoint=True, dtype=int)
101
+ print(f"视频总帧数: {total_frames}")
102
+ print(f"计划提取的帧索引: {indices}")
103
+
104
+ # 3. 确保输出目录存在
105
+ os.makedirs(output_dir, exist_ok=True)
106
+ video_basename = os.path.basename(video_path).rsplit('.', 1)[0]
107
+
108
+ # 4. 提取和保存帧 (保持不变)
109
+ frames_batch = vr.get_batch(indices)
110
+ frames_np = frames_batch.asnumpy()
111
+ frames_saved = 0
112
+
113
+ for i, frame_np in enumerate(frames_np):
114
+ image = Image.fromarray(frame_np)
115
+ output_filename = os.path.join(output_dir, f"{video_basename}_frame_{i:02d}.jpg")
116
+ image.save(output_filename)
117
+ frames_saved += 1
118
+
119
+ # ----------------------------------------------------
120
+ # 5. 🚨 新增功能:复制原始视频到输出目录
121
+ # ----------------------------------------------------
122
+ original_video_basename = os.path.basename(video_path)
123
+ destination_path = os.path.join(output_dir, original_video_basename)
124
+
125
+ try:
126
+ shutil.copyfile(video_path, destination_path)
127
+ print(f"✅ 原始视频已复制到: {destination_path}")
128
+ except Exception as e:
129
+ print(f"⚠️ 复制原始视频失败: {e}")
130
+
131
+ print(f"\n✅ 成功提取并保存了 {frames_saved} 帧到目录: {output_dir}")
132
+
133
+
134
+ # --- 示例用法(保持不变) ---
135
+ video_id = '00000104'
136
+ num_frames = 20
137
+
138
+ video_paths = [
139
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Oct31_1/steps_2000/00000020.mp4',
140
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Oct31_1/steps_2000/00000048.mp4',
141
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Oct31_1/steps_2000/00000109.mp4',
142
+ # 注意:下面两个路径的正则表达式可能不匹配,因为它们包含额外的目录 r1_p1/ 或 r1_p2/
143
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_vbench2_all1/r1_p1/wan-videos-t2v-512*288-30-seed-1/output_Oct31_1/steps_1000/00000001.mp4',
144
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_vbench2_all1/r1_p2/wan-videos-t2v-512*288-30-seed-1/output_Oct31_1/steps_1000/00000403.mp4'
145
+ ]
146
+
147
+ video_paths = [
148
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Oct31_1/steps_1000/00000369.mp4',
149
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Oct31_1/steps_1000/00000311.mp4',
150
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Oct31_1/steps_1000/00000301.mp4',
151
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Oct31_1/steps_1000/00000286.mp4',
152
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_vbench2_all_wan_aug/r1_p2/wan-videos-t2v-512*288-30-seed-1/output_Oct31_1/steps_1500/00000181.mp4'
153
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Oct31_1/steps_2000/00000109.mp4',
154
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Oct31_1/steps_1000/00000301.mp4',
155
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_1000/00000018.mp4',
156
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_1000/00000181.mp4',
157
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_1000/00000203.mp4',
158
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_1000/00000278.mp4',
159
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_1000/00000355.mp4',
160
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_1000/00000363.mp4',
161
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_1000/00000383.mp4',
162
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_1000/00000437.mp4',
163
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_1000/00000488.mp4'
164
+ ]
165
+
166
+ video_paths = [
167
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Nov2_1/steps_500/00000369.mp4',
168
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Nov2_1/steps_500/00000311.mp4',
169
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Nov2_1/steps_500/00000301.mp4',
170
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Nov2_1/steps_500/00000286.mp4',
171
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_vbench2_all_wan_aug/r1_p2/wan-videos-t2v-512*288-30-seed-1/output_Oct31_1/steps_1500/00000181.mp4'
172
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Nov2_1/steps_500/00000109.mp4',
173
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Nov2_1/steps_500/00000301.mp4',
174
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Nov2_1/steps_3500/00000018.mp4',
175
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Nov2_1/steps_3500/00000181.mp4',
176
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Nov2_1/steps_3500/00000203.mp4',
177
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Nov2_1/steps_3500/00000278.mp4',
178
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Nov2_1/steps_3500/00000355.mp4',
179
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Nov2_1/steps_3500/00000363.mp4',
180
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Nov2_1/steps_3500/00000383.mp4',
181
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Nov2_1/steps_3500/00000437.mp4',
182
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Nov2_1/steps_3500/00000488.mp4'
183
+ ]
184
+
185
+ video_paths = [
186
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval1/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000369.mp4',
187
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval1/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000311.mp4',
188
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval1/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000301.mp4',
189
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval1/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000286.mp4',
190
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval1/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000109.mp4',
191
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval1/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000301.mp4',
192
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000018.mp4',
193
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000181.mp4',
194
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000203.mp4',
195
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000278.mp4',
196
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000355.mp4',
197
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000363.mp4',
198
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000383.mp4',
199
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000437.mp4',
200
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000488.mp4'
201
+ ]
202
+
203
+ video_paths = [
204
+ '/nfs/ywang29/Reward_finetuning/flow_grpo/eval_outputs_videogen/step_000000/batch0001-001-rank1.mp4',
205
+ '/nfs/ywang29/Reward_finetuning/flow_grpo/eval_outputs_videogen/step_000000/batch0006-000-rank4.mp4',
206
+ '/nfs/ywang29/Reward_finetuning/flow_grpo/eval_outputs_videogen/step_000000/batch0017-001-rank6.mp4',
207
+ '/nfs/ywang29/Reward_finetuning/flow_grpo/eval_outputs_videogen/step_000000/batch0000-001-rank2.mp4',
208
+ '/nfs/ywang29/Reward_finetuning/flow_grpo/eval_outputs_videogen/step_000000/batch0006-000-rank4.mp4'
209
+ ]
210
+
211
+ video_paths = [
212
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Nov2_1/steps_4500/00000007.mp4',
213
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_2500/00000007.mp4',
214
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Nov2_1/steps_4500/00000001.mp4',
215
+ '/nfs/ywang29/Reward_finetuning/flow_grpo/eval_outputs_moviegen/step_000000/batch0000-000-rank0.mp4',
216
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_2500/00000001.mp4',
217
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_2500/00000001.mp4',
218
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_pickscore/steps_4000/00000001.mp4',
219
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000001.mp4',
220
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000007.mp4',
221
+ '/nfs/ywang29/Reward_finetuning/flow_grpo/eval_outputs_moviegen/step_000000/batch0001-000-rank1.mp4',
222
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_pickscore/steps_4000/00000007.mp4',
223
+ '/s3-code/ywang29/genml/compare_full_sample_oct14/output_Oct14_6/steps_3000/00000007.mp4'
224
+ ]
225
+
226
+ video_paths = [
227
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_Nov2_1/steps_5000/00000019.mp4',
228
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_Nov2_1/steps_5000/00000019.mp4',
229
+ '/s3-code/ywang29/genml/compare_full_sample_oct14/output_Oct14_6/steps_3000/00000049.mp4',
230
+ '/s3-code/ywang29/genml/compare_full_sample_oct14/output_Oct14_6/steps_3000/00000019.mp4',
231
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_Nov2_1/steps_5000/00000049.mp4',
232
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_Nov2_1/steps_5000/00000049.mp4',
233
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_pickscore/steps_4000/00000049.mp4',
234
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_pickscore/steps_4000/00000019.mp4'
235
+ ]
236
+
237
+ video_paths = {
238
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30-seed21/output_Oct31_1/steps_3000/00000002.mp4',
239
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30-seed21/output_Nov2_1/steps_5000/00000002.mp4',
240
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen/sel_compare1/wan-videos-t2v-512*288-30-seed21/output_pickscore/steps_1500/00000002.mp4',
241
+
242
+ }
243
+ video_paths = [
244
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/WfyhrsEuoHA_5_0to136.mp4',
245
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/samples/fig3/00000001.mp4',
246
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/samples/fig3/00000002.mp4'
247
+ ]
248
+ video_paths = [
249
+
250
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000049.mp4',
251
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_Nov2_1/steps_5000/00000049.mp4',
252
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Nov2_1/steps_3500/00000049.mp4',
253
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_pickscore/steps_1500/00000049.mp4',
254
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_pickscore/steps_4000/00000049.mp4',
255
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_Oct31_1/steps_2000/00000049.mp4',
256
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_Oct31_1/steps_4000/00000049.mp4',
257
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_Nov6/steps_1000/00000049.mp4',
258
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_Nov9/steps_1000/00000049.mp4',
259
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000019.mp4',
260
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_Nov2_1/steps_5000/00000019.mp4',
261
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Nov2_1/steps_3500/00000019.mp4',
262
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_pickscore/steps_1500/00000019.mp4',
263
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_pickscore/steps_4000/00000019.mp4',
264
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_Oct31_1/steps_2000/00000019.mp4',
265
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_Oct31_1/steps_4000/00000019.mp4',
266
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_Nov6/steps_1000/00000019.mp4',
267
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30/output_Nov9/steps_1000/00000019.mp4',
268
+ # '/s3-code/ywang29/genml/compare_full_sample_oct14/output_Oct14_6/steps_3000/00000049.mp4',
269
+ # '/s3-code/ywang29/genml/compare_full_sample_oct14/output_Oct14_6/steps_2000/00000049.mp4',
270
+ # '/s3-code/ywang29/genml/compare_full_sample_oct14/output_Oct14_6/steps_2000/00000019.mp4'
271
+
272
+ ]
273
+
274
+ video_paths = [
275
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Oct31_1/steps_3000/00000162.mp4',
276
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval1/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000162.mp4',
277
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval/wan-videos-t2v-512*288-30/output_Nov2_1/steps_3000/00000162.mp4'
278
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval_h3ae/wan-videos-t2v-512*288-40/output_Nov2_1/steps_2500/00000087.mp4',
279
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval_h3ae/wan-videos-t2v-512*288-40-seed42/output_pretrain/00000087.mp4',
280
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval_h3ae/wan-videos-t2v-512*288-40/output_Oct31_1/steps_1500/00000087.mp4',
281
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval_h3ae/wan-videos-t2v-512*288-40/output_Oct31_1/steps_1500/00000012.mp4',
282
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval_h3ae/wan-videos-t2v-512*288-40/output_Oct31_1/steps_1000/00000225.mp4',
283
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval_h3ae/wan-videos-t2v-512*288-40/output_Nov2_1/steps_2500/00000219.mp4',
284
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval_h3ae/wan-videos-t2v-512*288-40/output_Oct31_1/steps_1000/00000219.mp4',
285
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval_h3ae/wan-videos-t2v-512*288-40-seed42/output_pretrain/00000219.mp4',
286
+
287
+
288
+ ]
289
+ video_paths = [
290
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/cherrypick/ECCV/00000084.mp4',
291
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val_eccv1/Oct31_1-500/00000030.mp4',
292
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val_eccv1/Oct31_1-500/00000044.mp4',
293
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val_eccv1/Oct31_1-500/00000065.mp4',
294
+ ]
295
+
296
+ video_paths = [
297
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/Oct31_1-2500/00000021.mp4',
298
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/Oct31_1-500/00000021.mp4',
299
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/Nov2_1-2000/00000021.mp4',
300
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/Nov2_1-4000/00000021.mp4',
301
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/pickscore-1500/00000021.mp4',
302
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/pickscore-4000/00000021.mp4',
303
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_pretrained/00000021.mp4'
304
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_500/00000355.mp4'
305
+ ]
306
+
307
+ # video_paths = [
308
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/Oct31_1-2500/00000021.mp4',
309
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/Oct31_1-500/00000021.mp4',
310
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/Oct31_1-1000/00000021.mp4',
311
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/Oct31_1-1500/00000021.mp4',
312
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val_eccv1/Oct31_1-500/00000355.mp4',
313
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/Nov2_1-1000/00000021.mp4',
314
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/Nov2_1-2000/00000021.mp4',
315
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/Nov2_1-4000/00000021.mp4',
316
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/Nov2_1-5000/00000021.mp4',
317
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/pickscore-1000/00000021.mp4',
318
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/pickscore-1500/00000021.mp4',
319
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/pickscore-4000/00000021.mp4',
320
+ # '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_pretrained/00000021.mp4',
321
+ # '/nfs/ywang29/Reward_finetuning/flow_grpo/eval_outputs_videogen_116/step_000000/batch0001-000-rank2.mp4',
322
+ # '/nfs/ywang29/Reward_finetuning/flow_grpo/eval_outputs_videogen_236/step_000000/batch0001-000-rank2.mp4',
323
+
324
+
325
+ #
326
+ # output_paths = [
327
+ # './ECCV_compare/Oct31_1-2500',
328
+ # './ECCV_compare/Oct31_1-500',
329
+ # './ECCV_compare/Oct31_1-1000',
330
+ # './ECCV_compare/Oct31_1-1500',
331
+ # './ECCV/Oct31_1-500',
332
+ # './ECCV_compare/Nov2_1-1000',
333
+ # './ECCV_compare/Nov2_1-2000',
334
+ # './ECCV_compare/Nov2_1-4000',
335
+ # './ECCV_compare/Nov2_1-5000',
336
+ # './ECCV_compare/pickscore-1000',
337
+ # './ECCV_compare/pickscore-1500',
338
+ # './ECCV_compare/pickscore-4000',
339
+ # './ECCV_compare/pretrained',
340
+
341
+ # ]
342
+
343
+ video_paths = [
344
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30/output_Oct31_1/steps_500/00000355.mp4',
345
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000030.mp4',
346
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_eval1/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000084.mp4',
347
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val/wan-videos-t2v-512*288-30-seed42/output_pretrain/00000044.mp4'
348
+ ]
349
+ video_paths = [
350
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single_pickscore/UmemVqN8DSE_82_0to127_1/train_sample_full/sample-93-1.mp4',
351
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single_videoalign/UmemVqN8DSE_82_0to127/train_sample_full/sample-55-6.mp4',
352
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single/UmemVqN8DSE_82_0to127_1/train_sample_full/sample-24-6.mp4',
353
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single/UmemVqN8DSE_82_0to127_1/train_sample_full/sample-0-1.mp4'
354
+
355
+ ]
356
+ # output_paths = [
357
+ # './ECCV_single1/pickscore',
358
+ # './ECCV_single1/videoalign',
359
+ # './ECCV_single1/ours',
360
+ # './ECCV_single1/base',
361
+ # ]
362
+
363
+ video_paths = [
364
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_pretrained/00000002.mp4',
365
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/Nov2_1-2000/00000002.mp4',
366
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/Oct31_1-1000/00000002.mp4',
367
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_videogen_val_eccv1/pickscore-1500/00000002.mp4',
368
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30-seed21/output_Nov2_1/steps_2000/00000048.mp4'
369
+ ]
370
+ # output_paths = [
371
+ # './ECCV_compare1/base',
372
+ # './ECCV_compare1/videoalign',
373
+ # './ECCV_compare1/ours',
374
+ # './ECCV_compare1/pickscore',
375
+ # './ECCV_compare1/flow-grpo',
376
+ # ]
377
+
378
+ video_paths = [
379
+ '/s3-code/ywang29/genml/compare_sample5/wan-videos-t2v-512*288-30/output_pretrain/00000048.mp4',
380
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val_eccv1/Nov2_1-2000/00000048.mp4',
381
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val_eccv1/Oct31_1-500/00000048.mp4',
382
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val_eccv1/pickscore-1500/00000048.mp4',
383
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/validation_samples/samples_moviegen_val1/wan-videos-t2v-512*288-30-seed21/output_Nov2_1/steps_2000/00000048.mp4'
384
+ ]
385
+
386
+ video_paths = [
387
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single/e2a5be1d8b8b50f6ee57abbee80aa4fd393a9deb325bcdb2fafffd4cbfed87e5/train_sample_full/sample-73-1.mp4',
388
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single/e2a5be1d8b8b50f6ee57abbee80aa4fd393a9deb325bcdb2fafffd4cbfed87e5/train_sample_full/sample-0-2.mp4',
389
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single/ciijTd95uFE_23_181to339/train_sample_full/sample-51-1.mp4',
390
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single/ciijTd95uFE_23_181to339/train_sample_full/sample-0-1.mp4',
391
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single/3WnMJtG4uJ4_12_0to181/train_sample_full/sample-10-5.mp4',
392
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single/3WnMJtG4uJ4_12_0to181/train_sample_full/sample-0-5.mp4',
393
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_single/a95ffcd4b6d0da80f70c5257e9aa27c3688e6cd8fa614d2dff9fc4ab22607294/train_sample_full/sample-18-7.mp4',
394
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_single/a95ffcd4b6d0da80f70c5257e9aa27c3688e6cd8fa614d2dff9fc4ab22607294/train_sample_full/sample-0-7.mp4',
395
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single_pickscore/3WnMJtG4uJ4_12_0to181/train_sample_full/sample-124-0.mp4',
396
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single_pickscore/a95ffcd4b6d0da80f70c5257e9aa27c3688e6cd8fa614d2dff9fc4ab22607294/train_sample_full/sample-110-4.mp4',
397
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single/5d38bc6ea753be258ff2a437c563ae21e8a7cd4091778102a52abd347036711b/train_sample_full/sample-124-1.mp4',
398
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single/5d38bc6ea753be258ff2a437c563ae21e8a7cd4091778102a52abd347036711b/train_sample_full/sample-0-1.mp4',
399
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single_pickscore/5d38bc6ea753be258ff2a437c563ae21e8a7cd4091778102a52abd347036711b/train_sample_full/sample-161-1.mp4',
400
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single_pickscore/e2a5be1d8b8b50f6ee57abbee80aa4fd393a9deb325bcdb2fafffd4cbfed87e5/train_sample_full/sample-154-6.mp4',
401
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single_videoalign/3WnMJtG4uJ4_12_0to181/train_sample_full/sample-175-4.mp4',
402
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single_videoalign/5d38bc6ea753be258ff2a437c563ae21e8a7cd4091778102a52abd347036711b/train_sample_full/sample-94-1.mp4',
403
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single_videoalign/a95ffcd4b6d0da80f70c5257e9aa27c3688e6cd8fa614d2dff9fc4ab22607294/train_sample_full/sample-65-4.mp4',
404
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single_videoalign/e2a5be1d8b8b50f6ee57abbee80aa4fd393a9deb325bcdb2fafffd4cbfed87e5/train_sample_full/sample-78-5.mp4'
405
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_sd_single/5d38bc6ea753be258ff2a437c563ae21e8a7cd4091778102a52abd347036711b/train_sample_full/sample-1-0.mp4',
406
+ '/nfs/ywang29/Reward_finetuning/VideoX-Fun/output_single/a95ffcd4b6d0da80f70c5257e9aa27c3688e6cd8fa614d2dff9fc4ab22607294/train_sample_full/sample-2-0.mp4'
407
+ ]
408
+ # output_paths = [
409
+ # 'ECCV_single/ours'
410
+ # ]
411
+
412
+ # # 确保 output_paths 返回的是目录名,例如:'cherrypick_results/Oct31_1_2000_00000020'
413
+ sub_folder = 'ECCV_compare'
414
+
415
+ from pathlib import Path
416
+
417
+ # root_dir = Path('/nfs/ywang29/Reward_finetuning/flow_grpo/eval_outputs_grpo_moviegen_sel_356/')
418
+ # video_paths = []
419
+ # for file_path in root_dir.rglob("*.mp4"):
420
+ # video_paths.append(str(file_path))
421
+ # # print(file_path)
422
+ # import pdb
423
+ # pdb.set_trace()
424
+
425
+ output_paths = [get_eccv_single_supp_video_path(path) for path in video_paths]
426
+
427
+ for i in range(len(video_paths)):
428
+ extract_evenly_spaced_frames_decord(
429
+ video_path=video_paths[i],
430
+ output_dir=output_paths[i],
431
+ num_frames_to_extract=20,
432
+ )
433
+ # "In the video, a young boy and girl are seated at a dining table, engaged in a cooking activity. The boy is holding a jar of cream, while the girl is holding a bowl. On the table, there are several ingredients, including lemons, a vase with flowers, and a bottle of oil. The table is covered with a white tablecloth, and there are chairs around it. The setting appears to be a kitchen or dining area, and the atmosphere is casual and relaxed. The children seem to be enjoying their time together, and the video captures a moment of creativity and learning.",same,same,16.0,81,24.0,129,"{'Environment': ['The setting is a kitchen or dining area with a white tablecloth on the table. There are chairs around the table, and the atmosphere is casual and relaxed.', 'Good', 'The setting features a white tablecloth, chairs, and a casual atmosphere with natural ingredients like lemons and herbs. The environment appears relaxed and suitable for a kitchen or dining area activity.'], 'Object(s)': ['A young boy, a young girl, a jar of cream, a bowl, lemons, a vase with flowers, and a bottle of oil.', 'Good', 'The video includes a young boy and girl, a jar of cream, a bowl, lemons, a vase with flowers, and a bottle of oil. All objects are clearly visible and satisfy the given requirements perfectly.'], 'Object Location / Spatial Distribution': ['The boy is on the left holding the jar of cream, the girl is on the right holding the bowl. Several ingredients are scattered on the table. The vase with flowers is placed somewhere on the table, and the bottle of oil is nearby. The composition is slightly unbalanced with the focus on the children and ingredients on the table.', 'Fair', ""The boy is on the left but not holding the jar of cream. The girl is on the right holding a bowl. Ingredients are scattered, but there's no vase with flowers. The composition focuses on the children and table ingredients.""]}","{'Environment': ['The setting is a kitchen or dining area with a white tablecloth on the table. There are chairs around the table, and the atmosphere is casual and relaxed.', 'Good', 'The video shows a casual and relaxed setting with a white tablecloth, chairs, and a dining area. The presence of lemons, bowls, and other items suggests a kitchen or dining context, fulfilling all requirements.'], 'Object(s)': ['A young boy, a young girl, a jar of cream, a bowl, lemons, a vase with flowers, and a bottle of oil.', 'Good', 'The video features a young boy and girl, a jar of cream, a bowl, lemons, and a bottle of oil. However, there is no vase with flowers visible in the scene. All other objects are present and meet the requirement.'], 'Object Location / Spatial Distribution': ['The boy is on the left holding the jar of cream, the girl is on the right holding the bowl. Several ingredients are scattered on the table. The vase with flowers is placed somewhere on the table, and the bottle of oil is nearby. The composition is slightly unbalanced with the focus on the children and ingredients on the table.', 'Fair', 'The boy is not holding the jar of cream, and there is no visible vase with flowers or bottle of oil. The composition focuses on the children and ingredients, but the spatial distribution is slightly off.']}","{'Video Clarity': 'Good', 'Detail Realism': 'Good', 'Color Consistent': 'Good', 'Frame Stable': 'Good', 'Texture Consistent': 'Good'}","{'Video Clarity': 'Good', 'Detail Realism': 'Good', 'Color Consistent': 'Good', 'Frame Stable': 'Good', 'Texture Consistent': 'Good'}"
VideoX-Fun/cherrypick/human_eval_list.txt ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 103
2
+ 120
3
+ 121
4
+ 128
5
+ 129
6
+ 132
7
+ 142
8
+ 150
9
+ 164
10
+ 174
11
+ 175
12
+ 178
13
+ 181
14
+ 182
15
+ 183
16
+ 187
17
+ 188
18
+ 189
19
+ 190
20
+ 192
21
+ 202
22
+ 203
23
+ 207
24
+ 208
25
+ 210
26
+ 211
27
+ 212
28
+ 213
29
+ 214
30
+ 215
31
+ 222
32
+ 223
33
+ 236
34
+ 240
35
+ 245
36
+ 248
37
+ 255
38
+ 266
39
+ 267
40
+ 274
41
+ 294
42
+ 306
43
+ 332
44
+ 355
45
+ 361
46
+ 362
47
+ 363
48
+ 379
49
+ 383
50
+ 384
51
+ 426
52
+ 431
53
+ 437
54
+ 456
55
+ 458
56
+ 481
57
+ 488
58
+ 491
59
+ 494
60
+ 500
61
+ 503
62
+ 559
63
+ 562
64
+ 524
65
+ 549
66
+ 536
67
+ 521
68
+ 518
69
+ 585
70
+ 581
71
+ 632
72
+ 691
73
+ 698
74
+ 700
75
+ 734
76
+ 761
77
+ 762
78
+ 763
79
+ 793
80
+ 800
81
+ 809
82
+ 802
83
+ 826
84
+ 836
85
+ 838
86
+ 839
87
+ 843
88
+ 847
89
+ 853
90
+ 854
91
+ 859
92
+ 861
93
+ 862
94
+ 866
95
+ 867
96
+ 883
97
+ 887
98
+ 890
99
+ 2
100
+ 7
101
+ 8
102
+ 12
103
+ 18
104
+ 19
105
+ 20
106
+ 21
107
+ 30
108
+ 31
109
+ 33
110
+ 38
111
+ 40
112
+ 44
113
+ 48
114
+ 49
115
+ 56
116
+ 70
117
+ 92
118
+ 94
119
+ 112
VideoX-Fun/cherrypick/human_eval_sel.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import random
2
+ import json
3
+
4
+ def process_data(input_txt, source_txt, output_json):
5
+ # 1. 读取原始文件并【立即规范化】
6
+ existing_nums = []
7
+ existing_ints = set()
8
+
9
+ with open(input_txt, 'r', encoding='utf-8') as f:
10
+ for line in f:
11
+ clean_line = line.strip()
12
+ if clean_line:
13
+ num_int = int(clean_line)
14
+ existing_ints.add(num_int)
15
+ # 规范化为 8 位字符串
16
+ existing_nums.append(str(num_int).zfill(8))
17
+
18
+ # 2. 从 1-800 中寻找缺失的数字并补充
19
+ all_possible = set(range(1, 801))
20
+ candidate_pool = list(all_possible - existing_ints)
21
+
22
+ needed_count = 200 - len(existing_nums)
23
+ if needed_count > 0:
24
+ # 随机抽取缺失的数字
25
+ extra_ints = random.sample(candidate_pool, min(needed_count, len(candidate_pool)))
26
+ # 规范化补充的数字并合并
27
+ final_list = existing_nums + [str(n).zfill(8) for n in extra_ints]
28
+ else:
29
+ # 如果原始数据已经超过200个,根据需求截取前200个
30
+ final_list = existing_nums[:200]
31
+
32
+ # 3. 读取源文本文件
33
+ with open(source_txt, 'r', encoding='utf-8') as f:
34
+ # 使用 readlines 方便通过行号索引
35
+ source_lines = f.readlines()
36
+
37
+ result_dict = {}
38
+ for num_str in final_list:
39
+ # 将规范化的字符串转回整数以获取行号索引(1对应第0行)
40
+ line_idx = int(num_str) - 1
41
+
42
+ if 0 <= line_idx < len(source_lines):
43
+ result_dict[num_str] = source_lines[line_idx].strip()
44
+ else:
45
+ result_dict[num_str] = "Index Out of Range"
46
+
47
+ # 4. 储存为 JSON
48
+ with open(output_json, 'w', encoding='utf-8') as f:
49
+ json.dump(result_dict, f, ensure_ascii=False, indent=4)
50
+
51
+ print(f"处理完成!最终共有 {len(result_dict)} 条记录。")
52
+
53
+ # 调用示例
54
+ # process_data('my_numbers.txt', 'content_source.txt', 'final_output.json')
55
+ process_data('/nfs/ywang29/Reward_finetuning/VideoX-Fun/cherrypick/human_eval_list.txt', '/nfs/ywang29/Reward_finetuning/VideoX-Fun/MovieGenVideoBench_val.txt', 'human_eval_set.json')
56
+
VideoX-Fun/cherrypick/human_eval_set.json ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "00000103": "A man made of rocks walking in the forest, full-body shot.",
3
+ "00000120": "A side profile shot of a woman with fireworks exploding in the distance beyond her.",
4
+ "00000121": "A pink pig running fast toward the camera in an alley in Tokyo.",
5
+ "00000128": "A curious cat peering out from a cozy hiding spot.",
6
+ "00000129": "A group of vintage muscle cars rev their engines before drag racing down a straight strip of asphalt.",
7
+ "00000132": "A pole vaulter soaring over the bar with precision.",
8
+ "00000142": "A squirrel jumping tree to tree.",
9
+ "00000150": "A dragonfly flying on top of a flower beside a hummingbird.",
10
+ "00000164": "A chef skillfully tossing a salad in a bowl.",
11
+ "00000174": "A golfer sinking a long putt on the green.",
12
+ "00000175": "A woman sipping a steaming cup of tea.",
13
+ "00000178": "A group of skateboarders perform tricks on ramps and rails at a skate park, showcasing their skills.",
14
+ "00000181": "A person slicing a loaf of freshly baked bread.",
15
+ "00000182": "A person dipping a crispy French fry into ketchup.",
16
+ "00000183": "rogs leaping from lily pad to lily pad in a tranquil pond.",
17
+ "00000187": "A cat leaps out of a carboard box in a very high arch and lands into a taller box sitting next to the original box.",
18
+ "00000188": "a ninja walking through the desert carrying a case of wine while being followed by a pack of hyenas",
19
+ "00000189": "A gibbon swinging through the canopy.",
20
+ "00000190": "A cat dancing the tango",
21
+ "00000192": "A bride and groom sharing a tender first dance.",
22
+ "00000202": "A child's face lighting up with joy as they blow out the candles on their birthday cake.",
23
+ "00000203": "A silver sedan gracefully glides around a sharp corner on a scenic mountain road.",
24
+ "00000207": "A man is eating spaghetti",
25
+ "00000208": "A person takes a big bite of a juicy burger, the meat and cheese filling his mouth.",
26
+ "00000210": "A person sips on a smoothie, the cool and fruity flavors refreshing her mouth.",
27
+ "00000211": "A person is savoring a slice of pizza at a pizzeria.",
28
+ "00000212": "A person is happily munching on a bag of chips while watching TV.",
29
+ "00000213": "A person savors a spoonful of creamy soup, the flavors dancing on her tongue.",
30
+ "00000214": "The person's forehead creased with concentration as she worked on a challenging puzzle.",
31
+ "00000215": "The person walked into the room, his face lighting up with a warm smile.",
32
+ "00000222": "The person's forehead creased with worry as he listened to bad news.",
33
+ "00000223": "The person's chin quivered with emotion as he said goodbye to a loved one.",
34
+ "00000236": "The person's eyebrows arched in skepticism as she listened to a dubious claim.",
35
+ "00000240": "The person's nose scrunched up in distaste as she encountered a strong odor.",
36
+ "00000245": "A close-up shot of the person's face reveals his fear and desperation as he navigates the ship through the storm.",
37
+ "00000248": "Static camera shot. A dinasour running near some lions and chasing them away.",
38
+ "00000255": "Camera tracking shot. A man walking down a city street, holding a coffee cup in his hand. He is wearing a dark suit and red tie.",
39
+ "00000266": "A red panda taking a bite of a pizza",
40
+ "00000267": "A baby is learning to walk with his mother",
41
+ "00000274": "A Chinese couple are making dumplings together.",
42
+ "00000294": "A bear made of strawberrys is walking in the forest, its eyes looking around as if it is seeing the world for the first time",
43
+ "00000306": "A pair of hands skillfully knitting a colorful scarf, the yarn winding through their fingers with each stitch.",
44
+ "00000332": "A woman beamed with pride as she watched her child perform on stage.",
45
+ "00000355": "A close-up of honey being drizzled onto pancakes, the thick liquid flowing slowly and smoothly.",
46
+ "00000361": "A rally car accelerating through a muddy forest track.",
47
+ "00000362": "A speedboat accelerating across a lake, creating a large wake.",
48
+ "00000363": "A horse accelerating out of the starting gate at the beginning of a race.",
49
+ "00000379": "A rose is growing out of a stone",
50
+ "00000383": "a white and orange tabby alley cat is seen darting across a back street alley in a heavy rain, looking for shelter",
51
+ "00000384": "a photorealistic video of a butterfly that can swim navigating underwater through a beautiful coral reef",
52
+ "00000426": "Close-up of a man eating watermelon.",
53
+ "00000431": "A man pushes away a huge stone with superhuman strength.",
54
+ "00000437": "A teenager eating a slice of pizza, cheese stretching as they pull it away.",
55
+ "00000456": "A high-speed video of champagne being poured into a glass, with bubbles rising rapidly.",
56
+ "00000458": "A time-lapse video of a river flowing through a forest, with changing water levels and currents.",
57
+ "00000481": "A slow-motion video of a drink being poured into a martini glass, with detailed flow and splashes.",
58
+ "00000488": "A POV shot of a rock dropping into a lake, with ripples spreading across the water's surface.",
59
+ "00000491": "A serene mountain lake reflects the starry night sky as a small boat glides silently across the water, creating gentle ripples that disturb the perfect reflection.",
60
+ "00000494": "Bioluminescent waves gently wash ashore on a deserted beach, illuminating the sand with each cresting wave as a figure walks along the water's edge, leaving glowing footprints.",
61
+ "00000500": "A vast desert with towering sand dunes and a distant oasis.",
62
+ "00000503": "A haunted mansion with flickering candles and eerie shadows.",
63
+ "00000559": "In the middle of a rainy street, one person shares an umbrella with another, leading to a moment of connection as they walk together through the rain.",
64
+ "00000562": "A cat sitting at a grand piano, elegantly playing a classical piece with its paws.",
65
+ "00000524": "A peaceful riverside village with quaint cottages lines the water's edge, while villagers stroll along the riverbank or paddle small boats across the gentle current.",
66
+ "00000549": "Visitors wander through the grand palace, admiring the ornate architecture while fountains spray water in rhythmic patterns, and birds flit through the lush gardens.",
67
+ "00000536": "Vendors set up stalls at a bustling farmer’s market, displaying fresh fruits and vegetables, while people stroll through, selecting produce and enjoying the lively atmosphere.",
68
+ "00000521": "A serene lakeside cabin sits by the water’s edge, with a wooden dock extending into the lake where a rowboat is gently bobbing with the movement of the water.",
69
+ "00000518": "A serene lakeside cabin with a wooden dock and a rowboat.",
70
+ "00000585": "A flamingo in a yoga pose, balancing gracefully on one leg in a serene garden.",
71
+ "00000581": "A kangaroo wearing boxing gloves, sparring with a punching bag in a gym.",
72
+ "00000632": "A person sketching a landscape that comes to life as they draw.",
73
+ "00000691": "An astronaut fighting a large dinosaur",
74
+ "00000698": "Closeup of a hand spreading butter on a slice of bread.",
75
+ "00000700": "A time-lapse showing various colors of flowers blooming in a garden, starting as tiny buds pushing through the soil and gradually opening into vibrant blossoms, with petals unfurling in a dance of growth and sunlight.",
76
+ "00000734": "A steaming cup of tea in a cold room, with tendrils of steam rising and dissipating in the air above it.",
77
+ "00000761": "A first-person perspective of someone hiking up a mountain trail, with each step revealing more of the breathtaking landscape ahead.",
78
+ "00000762": "A first-person view of a surfer paddling out and catching a wave, the water rushing around them as they ride.",
79
+ "00000763": "A first-person experience of walking through a vibrant market, with colorful stalls and the sounds of vendors all around.",
80
+ "00000793": "A truck left alongside a train moving through the countryside, matching its speed and revealing the changing landscape.",
81
+ "00000800": "A truck right along a mountain trail, following a hiker as they make their way through the rugged terrain.",
82
+ "00000809": "A tilt-up from a city street, ascending to show the skyline with its mix of modern and historic architecture.",
83
+ "00000802": "A truck right along a beach, moving parallel to the shoreline as waves gently lap against the sand.",
84
+ "00000826": "A zoom-in on a clock face, focusing on the intricate movement of the hands and the ticking mechanism inside.",
85
+ "00000836": "A zoom-out from a detailed shot of an intricate snowflake, pulling back to show a snowy landscape.",
86
+ "00000838": "A zoom-out from a candle flame, gradually revealing the dimly lit room filled with flickering candles.",
87
+ "00000839": "A zoom-out from the detailed patterns on a butterfly's wing, pulling back to show the butterfly in its garden habitat.",
88
+ "00000843": "A pull-out from a child’s hands holding a small seashell, moving back to show the beach and the waves around them.",
89
+ "00000847": "A handheld perspective of someone hiking up a rocky trail, with the camera shaking slightly to mimic the rugged terrain.",
90
+ "00000853": "A tracking shot of a group of cyclists racing through a forest trail, with trees and foliage rushing by.",
91
+ "00000854": "A tracking shot of a train traveling through a snowy landscape, the scenery changing rapidly as it moves forward.",
92
+ "00000859": "Tracking shot. Cinematic scene. A 19th century scuba diver runs down a busy street in New York City. The light is natural and warm, glinting off of the diver's suit. The diver's suit is burnished and old, held together with rusted bolts. The diver's helmet is round, with a black round glass porthole in the front. All around the diver, people walk down the street in period specific attire, such as large corset dresses with sweeping skirts, tailored suits, and top hats. The scene should feel joyful and amusing, heightening the thrill of the running diver.",
93
+ "00000861": "Camera tracking shot. An early 19th century scuba diver with a huge iron helmet and an iron body suit lounges on an antique lawn chair. The light is diffused and gray, casting soft shadows along the scene. The diver brings a martini glass to his helmet and puts it back down. The year is 1912. The diver is in a grassy tree-filled park. People in period-accurate dress mill around, wearing long dresses and suits, holding parasols. The diver's suit is burnished and old, held together with rusted bolts. The diver tips the martini toward his helmet and clinks the glass against the glass. The scene should feel serene and beautiful, evoking the feeling of an impressionist painting.",
94
+ "00000862": "An imposing, atomic-powered, retro-futuristic robot strides down the red carpet at a glamorous movie premiere. Its bulky, gleaming exosuit shines under the bright lights of camera flashes, reflecting the glitz of the event. The robot’s large, round helmet, with its glowing visor, gives it an air of mysterious authority, while the articulated joints in its thick, metallic arms and legs move with precision. Its jetpack, attached to its back, hums softly as it powers the machine forward, and the crowd marvels at the fusion of vintage design and futuristic technology",
95
+ "00000866": "Miniature adorable monsters made out of wool and felt, dancing with each other, 3d render, octane, soft lighting, dreamy bokeh, cinematic.",
96
+ "00000867": "Cinematic closeup and detailed portrait of a reindeer in a snowy forest at sunset. The lighting is cinematic and gorgeous and soft and sun-kissed, with golden backlight and dreamy bokeh and lens flares. The color grade is cinematic and magical.",
97
+ "00000883": "A mother dog gently picks up a piece of meat and carefully places it in her puppy's bowl, her eyes filled with warmth and care as she watches her little one eat.",
98
+ "00000887": "A mother otter floating on her back in a river, cradling her pup on her stomach to keep it safe and warm in the gentle current.",
99
+ "00000890": "A mother koala carrying her baby on her back, climbing trees effortlessly while making sure her baby is securely nestled against her.",
100
+ "00000002": "Several giant wooly mammoths approach treading through a snowy meadow, their long wooly fur lightly blows in the wind as they walk, snow covered trees and dramatic snow capped mountains in the distance, mid afternoon light with wispy clouds and a sun high in the distance creates a warm glow, the low camera view is stunning capturing the large furry mammal with beautiful photography, depth of field.",
101
+ "00000007": "This close-up shot of a Victoria crowned pigeon showcases its striking blue plumage and red chest. Its crest is made of delicate, lacy feathers, while its eye is a striking red color. The bird’s head is tilted slightly to the side, giving the impression of it looking regal and majestic. The background is blurred, drawing attention to the bird’s striking appearance.",
102
+ "00000008": "Photorealistic closeup video of two pirate ships battling each other as they sail inside a cup of coffee.",
103
+ "00000012": "Extreme close up of a 24 year old woman’s eye blinking, standing in Marrakech during magic hour, cinematic film shot in 70mm, depth of field, vivid colors, cinematic",
104
+ "00000018": "The camera follows behind a white vintage SUV with a black roof rack as it speeds up a steep dirt road surrounded by pine trees on a steep mountain slope, dust kicks up from it’s tires, the sunlight shines on the SUV as it speeds along the dirt road, casting a warm glow over the scene. The dirt road curves gently into the distance, with no other cars or vehicles in sight. The trees on either side of the road are redwoods, with patches of greenery scattered throughout. The car is seen from the rear following the curve with ease, making it seem as if it is on a rugged drive through the rugged terrain. The dirt road itself is surrounded by steep hills and mountains, with a clear blue sky above with wispy clouds.",
105
+ "00000019": "Reflections in the window of a train traveling through the Tokyo suburbs.",
106
+ "00000020": "A drone camera circles around a beautiful historic church built on a rocky outcropping along the Amalfi Coast, the view showcases historic and magnificent architectural details and tiered pathways and patios, waves are seen crashing against the rocks below as the view overlooks the horizon of the coastal waters and hilly landscapes of the Amalfi Coast Italy, several distant people are seen walking and enjoying vistas on patios of the dramatic ocean views, the warm glow of the afternoon sun creates a magical and romantic feeling to the scene, the view is stunning captured with beautiful photography.",
107
+ "00000021": "A large orange octopus is seen resting on the bottom of the ocean floor, blending in with the sandy and rocky terrain. Its tentacles are spread out around its body, and its eyes are closed. The octopus is unaware of a king crab that is crawling towards it from behind a rock, its claws raised and ready to attack. The crab is brown and spiny, with long legs and antennae. The scene is captured from a wide angle, showing the vastness and depth of the ocean. The water is clear and blue, with rays of sunlight filtering through. The shot is sharp and crisp, with a high dynamic range. The octopus and the crab are in focus, while the background is slightly blurred, creating a depth of field effect.",
108
+ "00000030": "An extreme close-up of an gray-haired man with a beard in his 60s, he is deep in thought pondering the history of the universe as he sits at a cafe in Paris, his eyes focus on people offscreen as they walk as he sits mostly motionless, he is dressed in a wool coat suit coat with a button-down shirt , he wears a brown beret and glasses and has a very professorial appearance, and the end he offers a subtle closed-mouth smile as if he found the answer to the mystery of life, the lighting is very cinematic with the golden light and the Parisian streets and city in the background, depth of field, cinematic 35mm film.",
109
+ "00000031": "A beautiful silhouette animation shows a wolf howling at the moon, feeling lonely, until it finds its pack.",
110
+ "00000033": "A litter of golden retriever puppies playing in the snow. Their heads pop out of the snow, covered in.",
111
+ "00000038": "A grandmother with neatly combed grey hair stands behind a colorful birthday cake with numerous candles at a wood dining room table, expression is one of pure joy and happiness, with a happy glow in her eye. She leans forward and blows out the candles with a gentle puff, the cake has pink frosting and sprinkles and the candles cease to flicker, the grandmother wears a light blue blouse adorned with floral patterns, several happy friends and family sitting at the table can be seen celebrating, out of focus. The scene is beautifully captured, cinematic, showing a 3/4 view of the grandmother and the dining room. Warm color tones and soft lighting enhance the mood.",
112
+ "00000040": "The Glenfinnan Viaduct is a historic railway bridge in Scotland, UK, that crosses over the west highland line between the towns of Mallaig and Fort William. It is a stunning sight as a steam train leaves the bridge, traveling over the arch-covered viaduct. The landscape is dotted with lush greenery and rocky mountains, creating a picturesque backdrop for the train journey. The sky is blue and the sun is shining, making for a beautiful day to explore this majestic spot.",
113
+ "00000044": "A white and orange tabby cat is seen happily darting through a dense garden, as if chasing something. Its eyes are wide and happy as it jogs forward, scanning the branches, flowers, and leaves as it walks. The path is narrow as it makes its way between all the plants. the scene is captured from a ground-level angle, following the cat closely, giving a low and intimate perspective. The image is cinematic with warm tones and a grainy texture. The scattered daylight between the leaves and plants above creates a warm contrast, accentuating the cat’s orange fur. The shot is clear and sharp, with a shallow depth of field.",
114
+ "00000048": "A Samoyed and a Golden Retriever dog are playfully romping through a futuristic neon city at night. The neon lights emitted from the nearby buildings glistens off of their fur.",
115
+ "00000049": "Chef chopping onions in the kitchen for the preparation of the dish",
116
+ "00000056": "A Chinese man sits at a table and eats noodles with chopsticks",
117
+ "00000070": "Close-up of a bright blue parrot's feathers glittering in the light, showing its unique plumage and vibrant colors",
118
+ "00000092": "A close up portrait of a woman lit by the side, the camera pulls back.",
119
+ "00000094": "A close up of an older man in a warehouse, camera zoom out.",
120
+ "00000112": "Aerial shot of a drone moving fast in a dense green jungle.",
121
+ "00000619": "A person baking a cake inside a giant treehouse kitchen.",
122
+ "00000323": "A man is sipping a hot cup of coffee, steam rising from the mug.",
123
+ "00000712": "Moonlight streaming through the branches of a dense forest, casting intricate shadows on the forest floor.",
124
+ "00000173": "a real girl franatically running a dense forest with bushes, trees, in rainy day, the animals are running after her and she is screaming and shouting",
125
+ "00000736": "A high-speed capture of a water balloon being popped, showing the liquid form maintaining its shape momentarily before cascading down.",
126
+ "00000729": "A series of hanging icicles in winter, each refracting the sunlight into tiny, twinkling points of light.",
127
+ "00000130": "A butterfly lands directly on the nose of a German Shepherd, who then places the butterfly on a flower.",
128
+ "00000480": "A high-speed video of a liquid droplet forming and falling from a faucet.",
129
+ "00000434": "A skeleton wearing a flower hat and sunglasses dances in the wild at sunset.",
130
+ "00000326": "A person is biting into a juicy apple, the juice dripping down their chin.",
131
+ "00000413": "A ball of wool transforms into a cat made of wool",
132
+ "00000715": "Sun rays breaking through a misty morning fog in a dense forest, creating visible beams of light that highlight the dew on the leaves.",
133
+ "00000311": "A group of people are clapping to celebrate",
134
+ "00000782": "An aerial perspective of a group of dolphins swimming near the surface of a crystal-clear ocean, their movements synchronized.",
135
+ "00000530": "Crowds move through a vibrant street festival, colorful decorations hanging overhead, and booths lining the streets where people are enjoying food, games, and music.",
136
+ "00000415": "A dandelion transforms into a butterfly.",
137
+ "00000727": "Light passing through a fine glass sculpture, creating an intricate play of shadows and refracted colors on the surrounding surfaces.",
138
+ "00000695": "pov footage of an ant navigating the inside of an ant nest",
139
+ "00000037": "Archeologists discover a generic plastic chair in the desert, excavating and dusting it with great care.",
140
+ "00000594": "A person conducting a symphony of animals in a forest clearing.",
141
+ "00000609": "A person conducting a rainstorm with a conductor’s baton, directing the clouds and lightning.",
142
+ "00000730": "A droplet of water falling onto a hot surface, instantly evaporating into a wisp of steam that swirls gracefully into the air.",
143
+ "00000158": "A guitar is being swallowed by a volcano and engulfed in magma.",
144
+ "00000653": "Two boats colliding in a marina, the sound of wood and metal clashing.",
145
+ "00000485": "A hot air balloon descending back to the ground.",
146
+ "00000138": "A woman practicing her archery skills at a range.",
147
+ "00000386": "realistic video of people relaxing at beach, then a shark jumps out of the water halfway through and surprises everyone",
148
+ "00000124": "lizard catching a bug",
149
+ "00000227": "The person's eyebrows shot up in shock as he heard unexpected news.",
150
+ "00000086": "A first-person POV shot rapidly flies towards a house's front door at 10x speed.",
151
+ "00000777": "An over-the-shoulder shot of a photographer adjusting their camera, framing a beautiful sunset scene.",
152
+ "00000278": "Giant Pandas are eating hot noodles in a Chinese restaurant",
153
+ "00000256": "Camera arc shot. A dog barking at a squirrel.",
154
+ "00000001": "A stylish woman walks down a Tokyo street filled with warm glowing neon and animated city signage. She wears a black leather jacket, a long red dress, and black boots, and carries a black purse. She wears sunglasses and red lipstick. She walks confidently and casually. The street is damp and reflective, creating a mirror effect of the colorful lights. Many pedestrians walk about.",
155
+ "00000310": "A girl is unfolding a birthday gift.",
156
+ "00000552": "Waves gently roll onto the shore as someone walks along the edge of the water, their footprints being washed away with each retreating wave in the crystal-clear sea.",
157
+ "00000618": "A person playing an electric guitar made of lightning, with thunderous sound waves.",
158
+ "00000010": "Historical footage of California during the gold rush.",
159
+ "00000410": "A dynamic motion shot of a plant transforming into an octopus. The green leaves of the plant begin to elongate and twist, turning into flexible, writhing tentacles. The camera circles as the stem thickens and expands, morphing into the bulbous head of an octopus, its texture shifting to a mottled pattern of green. The transformation completes with the plant revealing a fully formed octopus, its tentacles moving gracefully in the water.",
160
+ "00000179": "A ferret tosses a ball with his mouth and a puppy chases after it.",
161
+ "00000514": "A futuristic underwater city with glass tunnels and marine wildlife.",
162
+ "00000523": "Workers move through a picturesque vineyard during the harvest season, carefully picking grapes and placing them into baskets as the sun bathes the vines in a warm glow.",
163
+ "00000201": "A basketball player dunking the ball with flair.",
164
+ "00000722": "A lighthouse beam cutting through the dense night fog, creating a focused, radiant path of light.",
165
+ "00000114": "Aerial shot of the ocean. a maelstrom forms in the water swirling around until it reveals the fiery depths below.",
166
+ "00000344": "A close-up of two football players colliding during a game, their helmets and bodies crashing together with force, highlighting the physicality and intensity of the sport.",
167
+ "00000159": "A hamster running on a spinning wheel.",
168
+ "00000681": "A panda is cooking for her child, her child is next to her.",
169
+ "00000357": "A high-speed video of a soap bubble popping, with the soapy liquid dispersing in all directions.",
170
+ "00000405": "a green blob and an orange blob are in love and dancing together",
171
+ "00000289": "A continuous first person view of Times Square in Nyew York transitioning into a cinematic scene of an alien city",
172
+ "00000083": "Handheld camera moving fast, flashlight light, in a white old wall in a old alley at night a black graffiti that spells ‘Runway’.",
173
+ "00000335": "A man looked away in shame when confronted with his wrongdoing.",
174
+ "00000257": "A bird made of fresh oranges rushes out of the orange",
175
+ "00000741": "A delicate layer of morning frost melting off a flower petal, the tiny droplets glistening like diamonds in the light.",
176
+ "00000107": "A cyclone of broken glass in an urban alleyway. dynamic movement.",
177
+ "00000269": "The CN Tower gradually freezes from the bottom to the top, with ice beginning to form at the base and slowly climbing upward.",
178
+ "00000119": "An empty warehouse where flowers start blooming from the concrete.",
179
+ "00000334": "A girl's face flushed with embarrassment after making a mistake in public.",
180
+ "00000708": "A plastic ruler being bent until it snaps back into its straight form when released.",
181
+ "00000436": "A toddler laughing with a mouthful of mashed potatoes.",
182
+ "00000526": "In a tranquil forest clearing, a sparkling waterfall cascades down into a clear pool, surrounded by lush greenery and flowers, with occasional birds fluttering by.",
183
+ "00000414": "An apple transforms into a bear.",
184
+ "00000087": "A pencil drawing an architectural plan.",
185
+ "00000349": "A shopping cart rolling down a hill and colliding with a parked car, groceries scattering.",
186
+ "00000563": "A dog dressed as a chef, expertly flipping pancakes in a kitchen.",
187
+ "00000366": "A high-speed train navigating a steep descent.",
188
+ "00000264": "A miniature baby zebra walking on a fingertip",
189
+ "00000490": "People move through a bustling city market at dawn, setting up stalls filled with vibrant colors and fresh produce while shoppers weave through the crowd, picking out the best items.",
190
+ "00000265": "A dog made of ice melts completely in a hot summer day",
191
+ "00000672": "A base jumper accelerating after leaping off a cliff, free-falling.",
192
+ "00000401": "a tortoise whose body is made of glass, with cracks that have been repaired using kintsugi, is walking on a black sand beach at sunset",
193
+ "00000151": "A chimp on the sidewalk doing a backflip on a skateboard.",
194
+ "00000167": "A toddler sharing a cookie with their stuffed animal.",
195
+ "00000441": "A woman yawning widely at the end of a long day.",
196
+ "00000220": "The person's lips curled up in a sly grin as he shared a secret joke.",
197
+ "00000388": "An ethereal moment as a figure is tethered to a majestic butterfly, soaring through a cosmic night filled with floating petals and vibrant colors, symbolizing the delicate balance between dreams and reality",
198
+ "00000785": "A pan left across a serene beach at sunrise, moving from the darkened shore to the brightening horizon.",
199
+ "00000586": "A raccoon wearing a detective's hat, solving mysteries with a magnifying glass and a notebook.",
200
+ "00000422": "A little boy rides a fast-moving dragon in the sky.",
201
+ "00000093": "Zoom in shot to the face of a young woman sitting on a bench in the middle of an empty school gym."
202
+ }
VideoX-Fun/cherrypick/mp4_to_gif.py ADDED
@@ -0,0 +1,312 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import argparse
2
+ import os
3
+ import re
4
+ import shutil
5
+ import subprocess
6
+ from pathlib import Path
7
+
8
+ try:
9
+ from decord import VideoReader, cpu
10
+ from PIL import Image
11
+ except ModuleNotFoundError:
12
+ VideoReader = None
13
+ cpu = None
14
+ Image = None
15
+
16
+
17
+ def parse_args():
18
+ parser = argparse.ArgumentParser(description="Convert mp4 files to gif.")
19
+ parser.add_argument("input", help="Path to an mp4 file or a directory containing mp4 files.")
20
+ parser.add_argument(
21
+ "--output",
22
+ help="Output gif path for a single file, or output directory for batch conversion.",
23
+ )
24
+ parser.add_argument(
25
+ "--fps",
26
+ type=float,
27
+ default=8.0,
28
+ help="GIF playback fps. Default: 8",
29
+ )
30
+ parser.add_argument(
31
+ "--width",
32
+ type=int,
33
+ default=None,
34
+ help="Resize gif to this width while preserving aspect ratio.",
35
+ )
36
+ parser.add_argument(
37
+ "--max-frames",
38
+ type=int,
39
+ default=None,
40
+ help="Keep at most this many frames by uniform sampling.",
41
+ )
42
+ parser.add_argument(
43
+ "--recursive",
44
+ action="store_true",
45
+ help="Recursively search for mp4 files when input is a directory.",
46
+ )
47
+ parser.add_argument(
48
+ "--trim-last-frames",
49
+ type=int,
50
+ default=0,
51
+ help="Drop the last N frames before generating the gif.",
52
+ )
53
+ return parser.parse_args()
54
+
55
+
56
+ def get_output_path(file_path, sub_folder=None):
57
+ root = file_path
58
+ step_match = re.search(r"output_(.*?)/steps_(\d+)/(\d+)\.mp4$", file_path)
59
+ generic_match = re.search(r"(.*?)/(\d+)\.mp4$", file_path)
60
+
61
+ if sub_folder:
62
+ base_root = f"/nfs/ywang29/Reward_finetuning/VideoX-Fun/cherrypick/{sub_folder}"
63
+ else:
64
+ base_root = "/nfs/ywang29/Reward_finetuning/VideoX-Fun/cherrypick"
65
+
66
+ normalized_root = root.lstrip("/").replace("\\", "/")
67
+
68
+ if step_match:
69
+ segment_1 = step_match.group(1)
70
+ segment_2 = step_match.group(2)
71
+ segment_3 = step_match.group(3)
72
+
73
+ print(f"原始路径: {file_path}")
74
+ print(f"1. 日期/版本段 (output_): {segment_1}")
75
+ print(f"2. 步数段 (steps_): {segment_2}")
76
+ print(f"3. 文件名序号: {segment_3}")
77
+
78
+ return f"{base_root}/{segment_1}_{segment_2}_{segment_3}"
79
+
80
+ if generic_match:
81
+ segment_1 = os.path.dirname(normalized_root)
82
+ segment_2 = generic_match.group(2)
83
+
84
+ print(f"原始路径: {file_path}")
85
+ print(f"1. 路径段: {segment_1}")
86
+ print(f"2. 文件名序号: {segment_2}")
87
+
88
+ return f"{base_root}/{segment_1}_{segment_2}"
89
+
90
+ base_name = os.path.basename(file_path).rsplit(".", 1)[0]
91
+ print(f"未找到匹配项,使用默认路径前缀: {base_name}")
92
+ if "flow_grpo" in file_path:
93
+ steps = root.split("/")[-3].split("_")[-1]
94
+ return f"{base_root}/{base_name}_fg_{steps}"
95
+
96
+ return f"{base_root}/{base_name}_default"
97
+
98
+
99
+ def get_eccv_single_supp_gif_path(video_path, base_dir=None):
100
+ normalized_path = os.path.normpath(video_path).replace("\\", "/")
101
+ match = re.search(r"/output[^/]+/([^/]+)/train_sample_full/([^/]+)\.mp4$", normalized_path)
102
+
103
+ if not match:
104
+ raise ValueError(
105
+ "video_path must follow '.../output*/{video_id}/train_sample_full/{video_name}.mp4'"
106
+ )
107
+
108
+ video_id = match.group(1)
109
+ video_name = match.group(2)
110
+
111
+ if base_dir is None:
112
+ project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
113
+ base_dir = os.path.join(project_root, "ECCV_single_supp")
114
+
115
+ save_dir = os.path.join(base_dir, video_id)
116
+ os.makedirs(save_dir, exist_ok=True)
117
+ return os.path.join(save_dir, f"{video_name}.gif")
118
+
119
+
120
+ def sample_frame_indices(num_frames, max_frames):
121
+ if max_frames is None or max_frames <= 0 or num_frames <= max_frames:
122
+ return list(range(num_frames))
123
+
124
+ if max_frames == 1:
125
+ return [0]
126
+
127
+ return [round(i * (num_frames - 1) / (max_frames - 1)) for i in range(max_frames)]
128
+
129
+
130
+ def trim_indices(indices, trim_last_frames):
131
+ if trim_last_frames <= 0:
132
+ return indices
133
+ if len(indices) <= trim_last_frames:
134
+ return []
135
+ return indices[:-trim_last_frames]
136
+
137
+
138
+ def resize_image(image, width):
139
+ if width is None or image.width == width:
140
+ return image
141
+
142
+ height = max(1, int(image.height * width / image.width))
143
+ return image.resize((width, height), Image.Resampling.LANCZOS)
144
+
145
+
146
+ def convert_mp4_to_gif(input_path, output_path, fps=8.0, width=None, max_frames=None, trim_last_frames=0):
147
+ if VideoReader is None or Image is None:
148
+ convert_mp4_to_gif_with_ffmpeg(
149
+ input_path,
150
+ output_path,
151
+ fps=fps,
152
+ width=width,
153
+ max_frames=max_frames,
154
+ trim_last_frames=trim_last_frames,
155
+ )
156
+ return
157
+
158
+ vr = VideoReader(str(input_path), ctx=cpu(0))
159
+ indices = trim_indices(sample_frame_indices(len(vr), max_frames), trim_last_frames)
160
+
161
+ frames = []
162
+ for frame_idx in indices:
163
+ frame = vr[frame_idx].asnumpy()
164
+ image = Image.fromarray(frame)
165
+ frames.append(resize_image(image, width).convert("P", palette=Image.Palette.ADAPTIVE))
166
+
167
+ if not frames:
168
+ raise ValueError(f"No frames found in {input_path}")
169
+
170
+ output_path.parent.mkdir(parents=True, exist_ok=True)
171
+ duration_ms = max(1, int(1000 / fps))
172
+ frames[0].save(
173
+ output_path,
174
+ save_all=True,
175
+ append_images=frames[1:],
176
+ duration=duration_ms,
177
+ loop=0,
178
+ optimize=False,
179
+ )
180
+
181
+
182
+ def get_video_frame_count_with_ffprobe(input_path):
183
+ ffprobe_path = shutil.which("ffprobe")
184
+ if ffprobe_path is None:
185
+ return None
186
+
187
+ command = [
188
+ ffprobe_path,
189
+ "-v",
190
+ "error",
191
+ "-count_packets",
192
+ "-select_streams",
193
+ "v:0",
194
+ "-show_entries",
195
+ "stream=nb_read_packets",
196
+ "-of",
197
+ "csv=p=0",
198
+ str(input_path),
199
+ ]
200
+ result = subprocess.run(command, check=False, capture_output=True, text=True)
201
+ if result.returncode != 0:
202
+ return None
203
+
204
+ output = result.stdout.strip()
205
+ if not output.isdigit():
206
+ return None
207
+ return int(output)
208
+
209
+
210
+ def convert_mp4_to_gif_with_ffmpeg(input_path, output_path, fps=8.0, width=None, max_frames=None, trim_last_frames=0):
211
+ ffmpeg_path = shutil.which("ffmpeg")
212
+ if ffmpeg_path is None:
213
+ raise RuntimeError("ffmpeg is not available, and decord/PIL are also unavailable.")
214
+
215
+ output_path.parent.mkdir(parents=True, exist_ok=True)
216
+
217
+ filters = [f"fps={fps:g}"]
218
+ if width is not None:
219
+ filters.append(f"scale={width}:-1:flags=lanczos")
220
+ if trim_last_frames > 0:
221
+ frame_count = get_video_frame_count_with_ffprobe(input_path)
222
+ if frame_count is None:
223
+ raise RuntimeError("Failed to get frame count with ffprobe for trim_last_frames.")
224
+ keep_frames = frame_count - trim_last_frames
225
+ if keep_frames <= 0:
226
+ raise ValueError(f"trim_last_frames={trim_last_frames} removes all frames from {input_path}")
227
+ filters.append(f"select=lt(n\\,{keep_frames})")
228
+
229
+ filter_str = ",".join(filters)
230
+ command = [
231
+ ffmpeg_path,
232
+ "-y",
233
+ "-i",
234
+ str(input_path),
235
+ "-vf",
236
+ filter_str,
237
+ ]
238
+ if max_frames is not None and max_frames > 0:
239
+ command.extend(["-frames:v", str(max_frames)])
240
+ command.append(str(output_path))
241
+
242
+ subprocess.run(command, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
243
+
244
+
245
+ def collect_mp4_files(input_path, recursive=False):
246
+ pattern = "**/*.mp4" if recursive else "*.mp4"
247
+ return sorted(path for path in input_path.glob(pattern) if path.is_file())
248
+
249
+
250
+ def build_default_output_path(input_path, output_arg=None):
251
+ if output_arg:
252
+ return Path(output_arg).expanduser().resolve()
253
+
254
+ normalized_path = os.path.normpath(str(input_path)).replace("\\", "/")
255
+ if "/train_sample_full/" in normalized_path and re.search(r"/output[^/]+/", normalized_path):
256
+ return Path(get_eccv_single_supp_gif_path(str(input_path)))
257
+
258
+ output_prefix = get_output_path(str(input_path))
259
+ return Path(f"{output_prefix}.gif")
260
+
261
+
262
+ def main():
263
+ args = parse_args()
264
+ input_path = Path(args.input).expanduser().resolve()
265
+
266
+ if not input_path.exists():
267
+ raise FileNotFoundError(f"Input path does not exist: {input_path}")
268
+
269
+ if input_path.is_file():
270
+ if input_path.suffix.lower() != ".mp4":
271
+ raise ValueError(f"Input file must be an mp4: {input_path}")
272
+
273
+ output_path = build_default_output_path(input_path, args.output)
274
+
275
+ convert_mp4_to_gif(
276
+ input_path=input_path,
277
+ output_path=output_path,
278
+ fps=args.fps,
279
+ width=args.width,
280
+ max_frames=args.max_frames,
281
+ trim_last_frames=args.trim_last_frames,
282
+ )
283
+ print(f"Saved gif to {output_path}")
284
+ return
285
+
286
+ mp4_files = collect_mp4_files(input_path, recursive=args.recursive)
287
+ if not mp4_files:
288
+ raise FileNotFoundError(f"No mp4 files found in directory: {input_path}")
289
+
290
+ output_dir = Path(args.output).expanduser().resolve() if args.output else None
291
+ if output_dir is not None:
292
+ output_dir.mkdir(parents=True, exist_ok=True)
293
+
294
+ for mp4_file in mp4_files:
295
+ if output_dir is not None:
296
+ relative_path = mp4_file.relative_to(input_path)
297
+ gif_path = output_dir / relative_path.with_suffix(".gif")
298
+ else:
299
+ gif_path = build_default_output_path(mp4_file)
300
+ convert_mp4_to_gif(
301
+ input_path=mp4_file,
302
+ output_path=gif_path,
303
+ fps=args.fps,
304
+ width=args.width,
305
+ max_frames=args.max_frames,
306
+ trim_last_frames=args.trim_last_frames,
307
+ )
308
+ print(f"Saved gif to {gif_path}")
309
+
310
+
311
+ if __name__ == "__main__":
312
+ main()
VideoX-Fun/cherrypick/rename.py ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import json
3
+ import shutil
4
+ from tqdm import tqdm
5
+
6
+ # --- 配置区域 ---
7
+ src_video_dir = '/root/human_eval/folder2' # 源视频文件夹
8
+ dst_video_dir = './human_eval/folder2' # 新视频存储文件夹(自动创建)
9
+ json_path = './human_eval_set.json' # 原 JSON 文件
10
+ output_json_path = './human_eval/human_evalx.json'
11
+ video_extension = '.mp4' # 视频后缀名
12
+
13
+ def copy_and_rename():
14
+ # 1. 创建目标文件夹
15
+ if not os.path.exists(dst_video_dir):
16
+ os.makedirs(dst_video_dir)
17
+ print(f"已创建新目录: {dst_video_dir}")
18
+
19
+ # 2. 加载原 JSON 数据
20
+ with open(json_path, 'r', encoding='utf-8') as f:
21
+ old_captions = json.load(f)
22
+
23
+ # 3. 获取源视频并排序
24
+ video_files = [f for f in os.listdir(src_video_dir) if f.endswith(video_extension)]
25
+ video_files.sort()
26
+
27
+ if not video_files:
28
+ print("错误:源文件夹中未找到视频文件。")
29
+ return
30
+
31
+ new_captions = {}
32
+
33
+ # 4. 遍历、复制并记录新映射
34
+ print(f"开始复制并重命名 {len(video_files)} 个视频...")
35
+
36
+ for i, old_filename in enumerate(tqdm(video_files, desc="处理中"), start=1):
37
+ # 生成新的 ID 和文件名
38
+ new_id = f"{i:08d}"
39
+ new_filename = new_id + video_extension
40
+
41
+ # 旧 ID(不含后缀)用于从 JSON 查找
42
+ old_id = os.path.splitext(old_filename)[0]
43
+
44
+ # 构建完整路径
45
+ src_path = os.path.join(src_video_dir, old_filename)
46
+ dst_path = os.path.join(dst_video_dir, new_filename)
47
+
48
+ # 执行文件复制 (copy2 会保留时间戳等元数据)
49
+ shutil.copy2(src_path, dst_path)
50
+
51
+ # 更新 JSON 映射:新 ID -> 旧 Caption
52
+ if old_id in old_captions:
53
+ new_captions[new_id] = old_captions[old_id]
54
+ else:
55
+ # 如果视频在 JSON 里没对应的 caption,给个默认值或空字符串
56
+ new_captions[new_id] = ""
57
+ print(f"警告: JSON 中缺失 ID {old_id} 的描述")
58
+
59
+ # 5. 保存新生成的 JSON
60
+ with open(output_json_path, 'w', encoding='utf-8') as f:
61
+ json.dump(new_captions, f, indent=4, ensure_ascii=False)
62
+
63
+ print(f"\n--- 处理完成 ---")
64
+ print(f"1. 新视频存放在: {dst_video_dir}")
65
+ print(f"2. 新 JSON 存放在: {output_json_path}")
66
+ print(f"注意:原文件夹 '{src_video_dir}' 未做任何改动。")
67
+
68
+ if __name__ == "__main__":
69
+ copy_and_rename()