{"id":30594790,"url":"https://github.com/tsopermon/yolo-auto-training","last_synced_at":"2025-08-29T20:08:38.918Z","repository":{"id":310806047,"uuid":"1041249014","full_name":"tSopermon/YOLO-auto-training","owner":"tSopermon","description":"System that allows automatic training of YOLO models, with minimum dataset preparetion","archived":false,"fork":false,"pushed_at":"2025-08-20T09:46:23.000Z","size":231,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-20T11:38:40.666Z","etag":null,"topics":["dataset","object-detection","ultralytics","yolo"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tSopermon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-20T07:52:19.000Z","updated_at":"2025-08-20T09:50:09.000Z","dependencies_parsed_at":"2025-08-20T11:38:49.298Z","dependency_job_id":"a88d504f-919d-4eff-81af-46fe867d5a10","html_url":"https://github.com/tSopermon/YOLO-auto-training","commit_stats":null,"previous_names":["tsopermon/yolo-auto-training"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/tSopermon/YOLO-auto-training","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tSopermon%2FYOLO-auto-training","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tSopermon%2FYOLO-auto-training/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tSopermon%2FYOLO-auto-training/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tSopermon%2FYOLO-auto-training/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tSopermon","download_url":"https://codeload.github.com/tSopermon/YOLO-auto-training/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tSopermon%2FYOLO-auto-training/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272756907,"owners_count":24987950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dataset","object-detection","ultralytics","yolo"],"created_at":"2025-08-29T20:08:36.291Z","updated_at":"2025-08-29T20:08:38.913Z","avatar_url":"https://github.com/tSopermon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YOLO Model Training with Automated Dataset System\n\nThis project provides comprehensive documentation and examples for training various YOLO model versions with **zero dataset preparation required**. The automated dataset system handles any dataset format and structure automatically.\n\n## Zero Dataset Preparation Required!**\n\n### **Simply Place Your Dataset and Train!**\n```bash\n# 1. Place ANY dataset in dataset/ folder (any structure/format)\n# 2. Run training - everything happens automatically!\npython train.py\n```\n\n**The system automatically:**\n- Detects dataset structure (flat, nested, mixed)\n- Converts any format (YOLO, COCO, XML, custom)\n- Reorganizes to YOLO standard\n- Generates `data.yaml` configuration\n- Starts training immediately\n\n**Supported Sources:**\n- Roboflow exports (any format)\n- Kaggle datasets\n- Custom annotations\n- Mixed sources\n- Any organization structure\n\n## Quick Start\n\n**NEW: [QUICK_START_GUIDE.md](QUICK_START_GUIDE.md)** - Get training in minutes with your dataset!\n\n### 1. Setup Environment\n```bash\n# Create and activate virtual environment\npython -m venv .venv\nsource .venv/bin/activate  # Linux/Mac\n# or\n.venv\\Scripts\\activate     # Windows\n\n# Install dependencies\npip install -r requirements.txt\n```\n\n### 2. Set Roboflow API Key (Optional)\n```bash\nexport ROBOFLOW_API_KEY=\"your_api_key_here\"\n```\n\n### 3. Prepare Dataset (Automatic!)\n```bash\n# Option A: Automatic (Recommended)\n# Just place your dataset in dataset/ folder and run training!\n\n# Option B: Manual preparation (if needed)\npython utils/prepare_dataset.py dataset/ --format yolov8\n\n# Option C: Roboflow export\nfrom roboflow import Roboflow\nrf = Roboflow(api_key=\"your_api_key\")\nproject = rf.workspace(\"workspace\").project(\"project_id\")\ndataset = project.version(\"version_number\").download(\"yolov8\")\n```\n\n### 4. Train YOLO Model (Any Version!)\n\n#### Full Interactive Experience (Recommended for Beginners)\n```bash\npython train.py\n```\nThe system will guide you through:\n- YOLO version selection (YOLO11, YOLOv8, YOLOv5)\n- Model size selection (nano to xlarge)\n- Training parameters (epochs, batch size, image size)\n- Advanced options and results folder naming\n\n#### Partial Interactive (Skip YOLO Selection)\n```bash\npython train.py --model-type yolov8\n```\nUses specified YOLO version, prompts for other parameters\n\n#### Fully Automated (No Prompts)\n```bash\npython train.py --model-type yolov8 --non-interactive --results-folder my_experiment\n```\nUses all defaults, creates organized results folder\n\n#### Custom Configuration (No Prompts)\n```bash\npython train.py \\\n  --model-type yolov8 \\\n  --epochs 100 \\\n  --batch-size 16 \\\n  --image-size 640 \\\n  --device cuda \\\n  --results-folder production_run \\\n  --non-interactive\n```\n\n### 5. Test Automated Dataset System (Optional)\n```bash\n# Test the automated dataset system\npython tests/test_auto_dataset.py\n\n# Run comprehensive YOLO testing\npython tests/test_comprehensive_yolo.py\n\n# Run standard tests\npython -m pytest tests/ -v\n```\n\n## **Automated Dataset System Features**\n\n### **Smart Detection \u0026 Conversion**\n- **Structure Detection**: Automatically identifies flat, nested, or mixed dataset structures\n- **Format Conversion**: Handles YOLO, COCO, XML, and custom annotation formats\n- **Class Detection**: Automatically detects classes from labels, annotations, or mapping files\n- **Split Management**: Creates optimal train/validation/test splits automatically\n\n### **Zero Configuration Required**\n- **Automatic Organization**: Converts any structure to YOLO standard\n- **Smart Validation**: Detects and reports dataset issues\n- **Error Recovery**: Handles corrupted files and missing labels gracefully\n- **YOLO Compatibility**: Works with YOLOv8, YOLOv5, and YOLO11\n\n### **Production Ready**\n- **Comprehensive Testing**: 100% test coverage for all YOLO versions\n- **Error Handling**: Robust error handling and recovery\n- **Performance Optimized**: Fast dataset preparation and validation\n- **Integration Ready**: Seamlessly integrates with training pipeline\n\n## Documentation Structure\n\n### **Complete Documentation System**\n- **[QUICK_START_GUIDE.md](QUICK_START_GUIDE.md)** - **NEW!** Get training in minutes\n- **[docs/README.md](docs/README.md)** - Main documentation hub\n- **[docs/workflow/README.md](docs/workflow/README.md)** - Comprehensive workflow documentation\n\n### **Quick Start with Documentation**\n1. **Start here**: [docs/README.md](docs/README.md) - Main documentation hub\n2. **System overview**: [docs/workflow/01-system-overview/01-system-overview.md](docs/workflow/01-system-overview/01-system-overview.md)\n3. **Training workflows**: [docs/workflow/04-integration-workflows/01-training-workflows.md](docs/workflow/04-integration-workflows/01-training-workflows.md)\n\n### **Complete Documentation Coverage**\nThe documentation covers **ALL files in ALL repository directories**:\n- **System Overview** - What the system does and why it matters\n- **Core Components** - Main training script, configuration, utilities, dataset system\n- **Supporting Systems** - Examples, testing, export, environment setup\n- **Integration Workflows** - Complete training processes, data flow, error handling\n- **Validation \u0026 Testing** - Quality assurance and maintenance procedures\n\n### **Examples \u0026 Scripts**\n- **[examples/export_dataset.py](examples/export_dataset.py)** - Practical export script\n\n## Supported YOLO Versions\n\n| Version | Status | Export Format | Training Method |\n|---------|--------|---------------|-----------------|\n| **YOLO11** | New Latest | `yolo11` | Repository/Ultralytics |\n| **YOLOv8** | Recommended | `yolov8` | Ultralytics |\n| **YOLOv5** | Stable | `yolo` | Repository/Ultralytics |\n| **YOLOv6** | Limited | `yolo` | Repository |\n| **YOLOv7** | Limited | `yolo` | Repository |\n| **YOLOv9** | Experimental | `yolo` | Repository |\n\n## Training Command Line Options\n\n### Basic Training Commands\n```bash\n# Full interactive experience - selects YOLO version and all parameters\npython train.py\n\n# Train YOLOv8 with interactive configuration (recommended for beginners)\npython train.py --model-type yolov8\n\n# Train YOLOv8 with custom parameters (no prompts)\npython train.py --model-type yolov8 --epochs 200 --batch-size 16 --image-size 640\n\n# Train with custom results folder (no folder prompt)\npython train.py --model-type yolov8 --results-folder experiment_2024\n\n# Skip all interactive prompts (use defaults)\npython train.py --model-type yolov8 --non-interactive\n\n# Resume training from checkpoint\npython train.py --model-type yolov8 --resume logs/previous_run/weights/last.pt\n\n# Validate only (no training)\npython train.py --model-type yolov8 --validate-only\n\n# Export model after training\npython train.py --model-type yolov8 --export\n```\n\n### Command Line Arguments\n- `--model-type`: Choose between `yolo11`, `yolov8`, `yolov5`\n- `--epochs`: Number of training epochs\n- `--batch-size`: Training batch size\n- `--image-size`: Input image size\n- `--device`: Training device (`cpu`, `cuda`, `auto`)\n- `--results-folder`: Custom folder name for results (skips interactive prompt)\n- `--non-interactive`: Skip all interactive configuration prompts (use defaults)\n- `--resume`: Path to checkpoint for resuming training\n- `--validate-only`: Only validate, don't train\n- `--export`: Export model after training\n\n### Interactive Configuration\nWhen you run training without `--non-interactive`, the system will prompt you for:\n\n1. **YOLO Version**: Choose between YOLO11, YOLOv8, YOLOv5 (if not specified)\n2. **Model Size**: Choose between n (nano), s (small), m (medium), l (large), x (xlarge)\n3. **Training Duration**: Number of epochs (default: 100)\n4. **Batch Size**: Training batch size (default: 8)\n5. **Image Size**: Input resolution (default: 1024)\n6. **Learning Rate**: Training learning rate (default: 0.01)\n7. **Device**: GPU or CPU training (default: cuda if available)\n8. **Advanced Options**: Early stopping patience, augmentation, validation frequency\n\n**Pro Tips:**\n- Press Enter to accept default values\n- Use `--non-interactive` for automated scripts\n- Combine with `--results-folder` to skip folder naming prompt\n\n## Custom Results Folder Feature\n- When you run training, the system prompts for a custom folder name\n- Results are organized in `logs/your_custom_name/` instead of the default `logs/yolo_training/`\n- Each training run gets its own organized folder with weights, plots, and logs\n- Folder names are automatically cleaned of invalid characters\n- Existing folders can be reused or new names can be chosen\n\n## Interactive Configuration Feature\n- **Beginner-Friendly**: Step-by-step prompts for all major training parameters\n- **Smart Defaults**: Press Enter to accept recommended values\n- **Model Selection**: Choose from nano (n) to xlarge (x) model sizes\n- **Parameter Guidance**: Helpful explanations for each setting\n- **Validation**: Input validation with helpful error messages\n- **Flexible**: Use `--non-interactive` to skip prompts for automation\n\n## Robust System Architecture\n\nThe system is built with enterprise-grade reliability:\n\n### Core Components\n- **Configuration Management**: Centralized config with validation and environment overrides\n- **Data Pipeline**: Robust dataset handling with automatic validation and preprocessing\n- **Training Engine**: Comprehensive training loop with checkpoint management and monitoring\n- **Evaluation System**: Multi-metric evaluation with visualization and reporting\n- **Export Utilities**: Multi-format model export (ONNX, TorchScript, CoreML, TensorRT)\n\n### Reliability Features\n- **Comprehensive Testing**: 98 tests covering all major components\n- **Error Handling**: Graceful failure handling with detailed logging\n- **Data Validation**: Automatic dataset structure and format validation\n- **Checkpoint Management**: Robust save/load with automatic cleanup\n- **Monitoring**: Real-time training progress with TensorBoard and W\u0026B integration\n\n## Prerequisites\n\n- **Python 3.8+** with pip\n- **Roboflow account** with annotated dataset\n- **API key** from Roboflow\n- **GPU** (recommended for training)\n\n## Installation\n\n### Option 1: Full Installation\n```bash\npip install -r requirements.txt\n```\n\n### Option 2: Minimal Installation\n```bash\npip install ultralytics roboflow torch torchvision\n```\n\n### Option 3: GPU Support\n```bash\n# Install PyTorch with CUDA support\npip install torch torchvision --index-url https://download.pytorch.org/whl/cu118\npip install ultralytics roboflow\n```\n\n## Learning Path\n\n### Beginner (Start Here)\n1. **Read** [docs/README.md](docs/README.md) - Main documentation hub\n2. **Try** [docs/workflow/01-system-overview/01-system-overview.md](docs/workflow/01-system-overview/01-system-overview.md) - System overview\n3. **Follow** [docs/workflow/04-integration-workflows/01-training-workflows.md](docs/workflow/04-integration-workflows/01-training-workflows.md) - Training workflows\n4. **Run** the example script\n5. **Train** your first model with `python train.py`\n\n### Intermediate\n1. **Explore** other YOLO versions\n2. **Customize** training parameters\n3. **Experiment** with different architectures\n4. **Optimize** for your use case\n\n### Advanced\n1. **Research** latest YOLO versions\n2. **Contribute** to the community\n3. **Deploy** models to production\n4. **Optimize** for edge devices\n\n## Common Issues\n\n### Export Problems\n- **Format not found**: Use `yolo` format as fallback\n- **API key errors**: Verify environment variable is set\n- **Permission denied**: Check Roboflow project access\n\n### Training Problems\n- **Memory errors**: Reduce batch size and image size\n- **CUDA issues**: Verify PyTorch CUDA installation\n- **Path errors**: Check `data.yaml` file paths\n\n### Performance Issues\n- **Slow training**: Use smaller model variants\n- **Low accuracy**: Increase dataset size and quality\n- **Overfitting**: Add more augmentation and regularization\n\n## Testing \u0026 Quality Assurance\n\n```bash\n# Run all tests\npython -m pytest tests/ -v\n\n# Run specific test categories\npython -m pytest tests/test_config.py -v\npython -m pytest tests/test_data_loader.py -v\npython -m pytest tests/test_training.py -v\n```\n\n## Demo and Examples\n\n### Interactive Demo\n```bash\npython demo_interactive_training.py\n```\nShows all available training modes and options\n\n### Quick Examples\n```bash\n# Interactive training with YOLO version selection\npython train.py\n\n# Non-interactive training with defaults\npython train.py --model-type yolov8 --non-interactive --results-folder quick_test\n\n# Custom configuration\npython train.py --model-type yolov8 --epochs 50 --batch-size 4 --image-size 640\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests for new functionality\n5. Submit a pull request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Support\n\n- **Issues**: Use GitHub Issues for bug reports\n- **Discussions**: Use GitHub Discussions for questions\n- **Documentation**: Check the docs/ folder for detailed guides\n- **Examples**: See the examples/ folder for practical usage\n\n## Acknowledgments\n\n- Ultralytics team for YOLOv8 implementation\n- Roboflow for dataset management tools\n- PyTorch community for deep learning framework\n- Contributors and users of this project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsopermon%2Fyolo-auto-training","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsopermon%2Fyolo-auto-training","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsopermon%2Fyolo-auto-training/lists"}