Trash classification with YOLOv8
https://github.com/ultralytics/ultralytics
https://github.com/pedropro/TACO
TODO:
- train model on TACO dataset
- integrate with external source sent over WiFi/BT
-
Camera is required (Webcam, USB camera, etc.)
-
Install the ultralytics package with pip:
pip install ultralytics -
pip may install a CPU-only version of pytorch, which is lightweight but leads to poor inference times. I recommend running YOLOv8 on a dedicated GPU with CUDA support. To check the pytorch version:
Run python, then enter
import torch print(torch.__version__)
If the version has +cpu appended at the end, it is a CPU-only version. The code can be run at this point withpython main.py, but if you wish to use CUDA continue to step 5. -
To set up a GPU:
First verify that your machine recognizes your GPU with
nvidia-smiUninstall the current pytorch version with
pip uninstall torch torchvision torchaudioThen head to the pytorch website to check which versions of CUDA Toolkit are supported in the 'Compute Platform' row.
- Install your desired CUDA Toolkit version here (I went with 12.1)
- Install the corresponding pytorch version with the command in 'Run this command' (see below)
Once both CUDA Toolkit and pytorch has been installed, you can run the check from step 4 to verify:
-
Setup is now complete, plug in your camera device and run
python main.py



