| |
|
|
| import os |
| import glob |
|
|
| def check_processing_progress(): |
| """Check the progress of FT_work dataset processing""" |
| |
| |
| data_path = "/apdcephfs_gy4/share_303628665/joywu/dataset/FT_work/videos/train" |
| save_path = "/apdcephfs_gy5/share_303628665/joyewu/research/AVH-Align/ft_work_preprocessed/train" |
| |
| print("=== FT_Work 数据集处理进度检查 ===") |
| print(f"数据路径: {data_path}") |
| print(f"输出路径: {save_path}") |
| print() |
| |
| |
| print("扫描数据集中的MP4文件...") |
| mp4_files = [] |
| for mp4_path in glob.glob(os.path.join(data_path, "**", "*.mp4"), recursive=True): |
| rel_path = os.path.relpath(mp4_path, data_path) |
| mp4_files.append(rel_path) |
| |
| total_files = len(mp4_files) |
| print(f"总MP4文件数: {total_files}") |
| print() |
| |
| |
| processed_files = [] |
| unprocessed_files = [] |
| failed_files = [] |
| |
| for mp4_file in mp4_files: |
| video_dir = os.path.dirname(mp4_file) |
| video_basename = os.path.basename(mp4_file) |
| |
| output_dir = os.path.join(save_path, video_dir) |
| roi_path = os.path.join(output_dir, video_basename[:-4] + '_roi.mp4') |
| wav_path = os.path.join(output_dir, video_basename[:-4] + '.wav') |
| |
| if os.path.exists(roi_path) and os.path.exists(wav_path): |
| processed_files.append(mp4_file) |
| else: |
| unprocessed_files.append(mp4_file) |
| |
| if "Real_CelebV-HQ" in mp4_file or "Real_HDTF" in mp4_file: |
| failed_files.append(mp4_file) |
| |
| |
| processed_count = len(processed_files) |
| unprocessed_count = len(unprocessed_files) |
| failed_count = len(failed_files) |
| |
| print("=== 处理状态汇总 ===") |
| print(f"✅ 已处理完成: {processed_count} 个文件 ({processed_count/total_files*100:.1f}%)") |
| print(f"⏳ 待处理: {unprocessed_count} 个文件 ({unprocessed_count/total_files*100:.1f}%)") |
| print(f"❌ 已知问题文件: {failed_count} 个文件") |
| print() |
| |
| if processed_files: |
| print("✅ 已处理的文件示例:") |
| for i, file in enumerate(processed_files[:5]): |
| print(f" {i+1}. {file}") |
| if len(processed_files) > 5: |
| print(f" ... 还有 {len(processed_files) - 5} 个文件") |
| print() |
| |
| if unprocessed_files: |
| print("⏳ 待处理的文件示例:") |
| for i, file in enumerate(unprocessed_files[:10]): |
| print(f" {i+1}. {file}") |
| if len(unprocessed_files) > 10: |
| print(f" ... 还有 {len(unprocessed_files) - 10} 个文件") |
| print() |
| |
| if failed_files: |
| print("❌ 已知问题文件 (可能需要特殊处理):") |
| for i, file in enumerate(failed_files[:10]): |
| print(f" {i+1}. {file}") |
| if len(failed_files) > 10: |
| print(f" ... 还有 {len(failed_files) - 10} 个文件") |
| print() |
| |
| |
| print("=== 建议 ===") |
| if unprocessed_count > 0: |
| print("1. 可以继续运行预处理命令,程序会自动跳过已处理的文件") |
| print("2. 建议使用较少的worker数量进行测试:") |
| print(" python deepfake_preprocess.py --dataset FT_work --split train --data_path /apdcephfs_gy4/share_303628665/joywu/dataset/FT_work/videos --save_path /apdcephfs_gy5/share_303628665/joyewu/research/AVH-Align/ft_work_preprocessed --max_workers 8") |
| |
| if failed_count > 0: |
| print("3. 对于Real_CelebV-HQ和Real_HDTF文件,可能需要检查视频格式或质量") |
| |
| print() |
| print("=== 重新运行命令 ===") |
| print("python deepfake_preprocess.py \\") |
| print(" --dataset FT_work \\") |
| print(" --split train \\") |
| print(" --data_path /apdcephfs_gy4/share_303628665/joywu/dataset/FT_work/videos \\") |
| print(" --save_path /apdcephfs_gy5/share_303628665/joyewu/research/AVH-Align/ft_work_preprocessed") |
|
|
| if __name__ == "__main__": |
| check_processing_progress() |