mpebtraining / fix_kaggle_dataset.py
jeyanthangj2004's picture
Upload 22 files
a1fc81e verified
# Fix for Kaggle: Update dataset YAML to use writable directory
import yaml
from pathlib import Path
print("=" * 80)
print("FIXING DATASET CONFIGURATION FOR KAGGLE")
print("=" * 80)
# Read the original dataset YAML
if Path('dataset_example.yaml').exists():
with open('dataset_example.yaml', 'r') as f:
dataset_config = yaml.safe_load(f)
# Change path to writable location
dataset_config['path'] = '/kaggle/working/VisDrone'
# Save modified YAML to working directory
with open('/kaggle/working/dataset.yaml', 'w') as f:
yaml.dump(dataset_config, f, default_flow_style=False)
print("✓ Created modified dataset.yaml in /kaggle/working/")
print(f" Dataset will download to: {dataset_config['path']}")
DATASET_CONFIG = '/kaggle/working/dataset.yaml'
else:
print("⚠ dataset_example.yaml not found")
DATASET_CONFIG = 'custom_dataset.yaml'
print(f"\nUsing dataset config: {DATASET_CONFIG}")
print("=" * 80)