12345678910111213141516171819202122232425262728 |
- import os
- import shutil
- # 定义目录结构
- dirs = {
- 'src/core': ['inference.py', 'feature_extractor.py', 'image_validation.py', 'ali_image_validation.py'],
- 'src/utils': ['bbox_visualizer.py', 'detection_visualizer.py', 'split_dataset.py', 'update_labels.py'],
- 'src/analysis': ['hotspot_analyzer.py', 'report_generator.py', 'analysis_report.py'],
- 'data/models': ['UAV-250321.onnx'],
- 'data/false_positive': [],
- 'tests': [],
- 'outputs/archive': []
- }
- # 创建目录结构
- for dir_path in dirs.keys():
- os.makedirs(dir_path, exist_ok=True)
- # 移动文件
- for target_dir, files in dirs.items():
- for file in files:
- if os.path.exists(file):
- shutil.move(file, os.path.join(target_dir, file))
- print(f'Moved {file} to {target_dir}/')
- else:
- print(f'Warning: {file} not found')
- print('Project reorganization completed!')
|