Restore api_docs.py and add comprehensive file structure to README

 API Documentation Restored:
- Kept api_docs.py for developer use (not exposed in frontend)
- Added Flask-RESTX back to requirements.txt
- Swagger UI available at http://localhost:5003/docs/ for developers

 Enhanced README Documentation:
- Added comprehensive project file structure
- Detailed directory tree with all files and folders
- Key files description table with purpose and usage
- Clear separation between user-facing and developer files

 File Organization:
- Documented all 40+ files and directories in the project
- Explained training outputs and model artifacts
- Clarified virtual environment and temporary directories
- Added file size and content descriptions

 Developer vs User Separation:
- main.py: User-facing web interface (port 5002)
- api_docs.py: Developer-only Swagger UI (port 5003)
- Clear documentation of intended usage for each component

The README now provides a complete overview of the project structure for both users and developers.
This commit is contained in:
Aherobo Ovie Victor
2025-07-11 21:38:19 +01:00
parent 7b9de2b833
commit bdc171b009
2 changed files with 43 additions and 7 deletions
+42 -7
View File
@@ -49,7 +49,8 @@ python3 test_api.py
```
ds_task_recycling_project/
├── main.py # Flask API application
├── main.py # Flask API application (main interface)
├── api_docs.py # Swagger UI API documentation (developer only)
├── train.py # YOLOv8 training script
├── inference_utils.py # Detection and visualization utilities
├── prepare_dataset.py # Dataset preparation script
@@ -57,24 +58,58 @@ ds_task_recycling_project/
├── setup.py # Automated setup script
├── requirements.txt # Python dependencies
├── dataset.yaml # YOLO dataset configuration
├── .gitignore # Git ignore file for ML projects
├── VALIDATION_CHECKLIST.md # Project validation checklist
├── templates/ # Frontend templates
│ └── index.html # QA testing web interface
├── static/ # Frontend assets
│ ├── style.css # Styling for web interface
│ └── script.js # JavaScript for web interface
├── venv/ # Virtual environment (created by user)
├── training/ # Dataset directory
│ ├── memory/ # Images with memory modules + labels
│ ├── memory/ # Images with memory modules + YOLO labels
│ │ ├── out1.png # Sample motherboard image with memory
│ │ ├── out1.txt # YOLO format annotation file
│ │ └── ... # 19 more image/label pairs
│ ├── no_memory/ # Images without memory modules
│ ├── train/ # Training split (80%)
│ └── val/ # Validation split (20%)
│ ├── out21.png # Sample motherboard image without memory
│ └── ... # 19 more images (no labels needed)
│ ├── train/ # Training split (80% = 32 images)
│ │ ├── images/ # Training images
│ │ └── labels/ # Training labels
│ └── val/ # Validation split (20% = 8 images)
│ ├── images/ # Validation images
│ └── labels/ # Validation labels
├── uploads/ # Temporary upload directory (created at runtime)
└── runs/ # Training outputs (created after training)
└── detect/
└── memory_module_detection/
── weights/
├── best.pt # Best model weights
└── last.pt # Last epoch weights
── weights/
├── best.pt # Best model weights
└── last.pt # Last epoch weights
├── train_batch*.jpg # Training visualization
├── val_batch*.jpg # Validation visualization
├── confusion_matrix.png # Model performance metrics
├── results.png # Training curves
└── args.yaml # Training arguments
```
### **📁 Key Files Description**
| File/Directory | Purpose | Usage |
|----------------|---------|-------|
| `main.py` | Main Flask API application | `python3 main.py` |
| `api_docs.py` | Swagger UI documentation (developer only) | `python3 api_docs.py` |
| `train.py` | YOLOv8 model training | `python3 train.py` |
| `inference_utils.py` | Detection utilities and classes | Imported by other scripts |
| `test_api.py` | Comprehensive API testing | `python3 test_api.py` |
| `setup.py` | Automated project setup | `python3 setup.py` |
| `templates/index.html` | Web interface for QA testing | Served by Flask |
| `static/` | CSS, JavaScript, and assets | Served by Flask |
| `training/` | Complete dataset with annotations | Used by training script |
| `runs/` | Model training outputs | Created after training |
| `venv/` | Python virtual environment | Created by user |
## 🤖 Algorithm Choice & Technical Decisions
### 1. **Algorithm Choice: YOLOv8 Nano**
+1
View File
@@ -8,6 +8,7 @@ Pillow==10.0.1
# Web Framework
Flask==2.3.3
Flask-CORS==4.0.0
Flask-RESTX==1.3.0
Werkzeug==2.3.7
# Data Processing