Common Issues and Solutions
This guide covers the most common issues you might encounter when using Reciclaje AI and their solutions.Most issues can be resolved by ensuring all dependencies are properly installed and the model file is in the correct location.
Camera Issues
Webcam Not Detected
Webcam Not Detected
Problem: The application fails to access the webcam or shows a black screen.Solutions:
-
Check camera permissions:
- On Linux, ensure your user has access to
/dev/video0 - On Windows, check Privacy Settings > Camera
- On macOS, grant camera permissions in System Preferences
- On Linux, ensure your user has access to
-
Verify camera index:
-
Test camera with OpenCV:
-
Remove CAP_DSHOW flag (Windows):
If you’re not on Windows, remove the
cv2.CAP_DSHOWflag frommain.py:219:
Low Frame Rate or Lag
Low Frame Rate or Lag
Problem: Video stream is slow or laggy.Solutions:
-
Reduce resolution:
-
Enable GPU acceleration:
- Install CUDA toolkit if you have an NVIDIA GPU
- Install PyTorch with CUDA support
-
Optimize YOLO settings:
Model Issues
Model File Not Found
Model File Not Found
Problem: Error:
FileNotFoundError: [Errno 2] No such file or directory: 'Modelos/best.pt'Solutions:-
Download the model:
- Visit Hugging Face - AprendeIngenia/recyclingAI
- Download the
best.ptfile
-
Create the correct directory structure:
-
Verify file location:
Poor Detection Accuracy
Poor Detection Accuracy
Problem: The model doesn’t detect objects correctly or has low confidence.Known Limitations:
- Poor lighting conditions can affect accuracy
- Image noise or blur reduces detection quality
- Unusual viewing angles may impact results
- Rare or unusual waste items not in training data
-
Improve lighting:
- Use consistent, bright lighting
- Avoid shadows and backlighting
-
Position objects clearly:
- Place objects within camera frame
- Avoid overlapping items
- Use a neutral background
-
Adjust confidence threshold:
-
Clean camera lens:
- Ensure webcam is clean and focused
Dependency Issues
Import Errors or Missing Packages
Import Errors or Missing Packages
Problem:
ModuleNotFoundError or ImportError when running the application.Solutions:-
Install all required dependencies:
-
Create a virtual environment:
-
Check Python version:
-
Verify package installation:
Ultralytics/YOLO Installation Issues
Ultralytics/YOLO Installation Issues
Problem: Cannot install or import
ultralytics package.Solutions:-
Update pip:
-
Install ultralytics:
-
Check for conflicts:
-
Use specific version:
GUI Issues
Setup Images Not Found
Setup Images Not Found
Problem: Error:
FileNotFoundError for images in setUp/ directory.Solutions:-
Verify setUp directory exists:
-
Required files in setUp/ directory:
Canva.png- Background imagemetal.png,vidrio.png,plastico.png,carton.png,medical.pngmetaltxt.png,vidriotxt.png,plasticotxt.png,cartontxt.png,medicaltxt.png
-
Clone the complete repository:
The GUI version (
main.py) requires all setup images. Use TrashDetect.py for a simpler version without GUI.Tkinter Not Available
Tkinter Not Available
Problem: On Fedora:On macOS:Alternative: Use
ImportError: No module named 'tkinter'Solutions:On Ubuntu/Debian:TrashDetect.py which doesn’t require Tkinter.Performance Issues
High CPU Usage
- Reduce video resolution
- Lower FPS in capture settings
- Close other applications
- Use GPU acceleration if available
Memory Leaks
- Restart the application periodically
- Check for proper resource cleanup
- Monitor with
htopor Task Manager - Update to latest ultralytics version
Getting Help
If you continue to experience issues:Watch Tutorial
Watch the complete video tutorial for setup and usage
GitHub Issues
Report bugs or request features on GitHub
Community
Join the community and ask questions
Contributing
Help improve the project by contributing
Debugging Tips
-
Check all file paths:
-
Test components individually:
- Test camera capture separately
- Test YOLO model with a static image
- Test GUI components independently
-
Review error messages:
- Read the full stack trace
- Note the line number where error occurs
- Check if file paths are correct
-
Update dependencies: