Overview
This guide will walk you through the complete installation process for Reciclaje AI, from setting up Python to installing all required dependencies.Before proceeding, ensure your system meets all requirements.
Installation Steps
Verify Python Installation
Confirm that Python 3.8-3.11 is installed on your system:Or on some systems:If Python is not installed, download it from python.org.
Clone the Repository
Clone the Reciclaje AI repository from GitHub:Alternatively, download the ZIP file and extract it to your preferred location.
Create Virtual Environment (Recommended)
Create and activate a virtual environment to isolate dependencies:You should see
(venv) appear in your terminal prompt.Using a virtual environment prevents dependency conflicts with other Python projects.
Install Core Dependencies
Install all required Python packages:This will install:
- ultralytics: YOLOv8 framework for object detection
- opencv-python: Computer vision library
- numpy: Numerical computing library
- pillow: Image processing library
- imutils: Convenience functions for OpenCV
Install GUI Dependencies
Tkinter is usually included with Python, but if it’s missing:Verify tkinter installation:
Download the Model
Download the pre-trained YOLOv8 model from HuggingFace. See the detailed Model Download Guide.Quick download:Or download manually from HuggingFace and place it in the
Modelos/ directory.GPU Support (Optional)
NVIDIA GPU Setup
For faster inference with CUDA-enabled GPUs:Install CUDA Toolkit
Download and install CUDA from NVIDIA’s website.Recommended version: CUDA 11.8 or 12.1
Install PyTorch with CUDA
Reinstall PyTorch with CUDA support:Replace
cu118 with your CUDA version (e.g., cu121 for CUDA 12.1).Troubleshooting
Common Installation Issues
ImportError: No module named 'cv2'
ImportError: No module named 'cv2'
OpenCV is not installed correctly. Try:If still failing, try the headless version:
ModuleNotFoundError: No module named 'tkinter'
ModuleNotFoundError: No module named 'tkinter'
Tkinter is not available. See Step 6 for platform-specific installation instructions.On Linux, you may need to install python3-tk from your package manager.
Ultralytics installation fails
Ultralytics installation fails
This usually indicates a pip or network issue:
Camera not detected (Error: Can't open camera)
Camera not detected (Error: Can't open camera)
Verify camera permissions and availability:Windows: Check Device Manager for camera status
macOS: Grant camera permissions in System Preferences > Security & Privacy
Linux: Ensure user is in the video group:Test camera manually:
Model file not found (Modelos/best.pt)
Model file not found (Modelos/best.pt)
Ensure the model file is downloaded and placed in the correct directory:If missing, follow the Model Download Guide.
GUI window doesn't appear
GUI window doesn't appear
This may be a display or tkinter issue:Linux: Install X11 dependencies:Remote SSH: Enable X11 forwarding or use the command-line version (
TrashDetect.py) instead.Platform-Specific Notes
Windows
macOS
If opencv-python fails to install:Linux
For GUI support, install additional libraries:Verifying the Installation
Run the basic detection script to verify everything works:The first run may take longer as the model loads into memory.
Next Steps
Now that installation is complete:Quick Start
Learn how to run your first detection
Camera Configuration
Configure camera settings for detection
Model Overview
Learn about the YOLOv8 model
Troubleshooting
Get help with common issues