Overview
Reciclaje AI uses a custom-trained YOLOv8 model for detecting and classifying waste materials. The model is hosted on HuggingFace and must be downloaded before you can run the application.Model Information
Model Details
- Model Type: YOLOv8 (You Only Look Once v8)
- Framework: Ultralytics
- Task: Object Detection and Classification
- Classes: 5 waste categories
- Metal
- Glass
- Plastic
- Carton (Cardboard)
- Medical Waste
- Format: PyTorch (.pt)
- File Size: ~6 MB
- Hosting: HuggingFace Model Hub
This model has been specifically trained on waste and recyclable materials, providing accurate classification for common household and industrial waste items.
Download Methods
Method 1: Direct Download (Recommended)
Visit HuggingFace Repository
Navigate to the model repository:https://huggingface.co/AprendeIngenia/recyclingAI
Download the Model File
Click on the “Files and versions” tab, then download
best.pt.Or use direct link:Method 2: Using wget (Linux/macOS)
Download directly from the command line:Method 3: Using curl
Alternative command-line download:Method 4: Using Python
Download programmatically with Python:download_model.py and run:
Method 5: Using HuggingFace Hub (Advanced)
Use the HuggingFace Hub library for advanced features:Verification
Verify Download
Check that the model file exists and has the correct size:Test Model Loading
Verify the model can be loaded by Ultralytics:If the model loads correctly and shows the 5 waste categories, your setup is complete!
Model Performance
Training Dataset
The model was trained on a diverse dataset including:- Various lighting conditions
- Different angles and perspectives
- Multiple object sizes
- Real-world waste scenarios
Expected Accuracy
- Overall mAP: ~85-90%
- Metal detection: High accuracy on cans, foil, and metal containers
- Glass detection: Good performance on bottles and jars
- Plastic detection: Excellent on bottles, bags, and containers
- Carton detection: Strong on cardboard boxes and paper products
- Medical waste: Reliable on syringes, masks, and medical packaging
Using Custom Models
Training Your Own Model
If you want to train a custom model:Export Trained Model
Your trained model will be saved as
best.pt in the runs/detect/train/weights/ directory.Using Different Model Sizes
YOLOv8 comes in different sizes. You can use alternatives:- YOLOv8n (Nano): Fastest, lowest accuracy
- YOLOv8s (Small): Balanced speed and accuracy
- YOLOv8m (Medium): Good accuracy, moderate speed
- YOLOv8l (Large): High accuracy, slower
- YOLOv8x (Extra Large): Highest accuracy, slowest
Troubleshooting
Download fails or times out
Download fails or times out
Try these solutions:
- Use a different download method (wget, curl, or manual)
- Check your internet connection
- Verify HuggingFace is accessible in your region
- Try downloading at a different time
- Use a VPN if HuggingFace is blocked
Model file is corrupt or incomplete
Model file is corrupt or incomplete
Symptoms: File size is incorrect or model won’t loadSolution:
RuntimeError when loading model
RuntimeError when loading model
Error message:
RuntimeError: Error(s) in loading state_dictThis usually indicates:- Incompatible Ultralytics version
- Corrupted model file
Permission denied when creating Modelos directory
Permission denied when creating Modelos directory
On Linux/macOS:Or navigate to a directory where you have write permissions.
Model predictions are inaccurate
Model predictions are inaccurate
Potential causes:
- Poor lighting conditions
- Camera quality issues
- Objects too small or too far
- Wrong model file
Model Updates
Checking for Updates
Periodically check the HuggingFace repository for model improvements: https://huggingface.co/AprendeIngenia/recyclingAIUpdating the Model
To update to a newer version:Next Steps
With the model downloaded and verified:Quick Start
Run your first waste detection
Model Overview
Learn about model specifications
CLI Detection
Use the command-line interface
GUI Application
Use the graphical interface