Real-time product and object detection using the latest Ultralytics YOLO models with full GPU acceleration (CUDA).
This system detects any product or object while ignoring humans, giving each detected item a unique color for easy distinction.
hand_product/
│
├── main.py # Main detection script
├── requirements.txt # Dependencies
└── README.md # Documentation
python -m venv .venv
.venv\Scripts\activate # On Windows
source .venv/bin/activate # On Linux/macOS
Ensure your PyTorch build supports CUDA:
pip uninstall torch torchvision torchaudio -y
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
Then install the rest:
pip install -r requirements.txt
python main.py
(If you add a --source parameter in code)
python main.py --source path/to/video.mp4
Press ESC to close the window.
yolov8l.pt or higher) on your GPU.Example output:
bottle 0.89
cell phone 0.91
laptop 0.84
ultralytics>=8.3.223
opencv-python
torch>=2.3.0
torchvision
torchaudio
| Component | Example |
|---|---|
| GPU | NVIDIA RTX 3060 12GB |
| CUDA | 12.1 |
| Python | 3.12 |
| OS | Windows 10 / 11 |
| Model | Size | Speed | Accuracy |
|---|---|---|---|
yolov8n.pt |
Nano | ⚡⚡⚡ | Basic |
yolov8s.pt |
Small | ⚡⚡ | Medium |
yolov8m.pt |
Medium | ⚡ | Balanced |
yolov8l.pt |
Large | ⚡ | High Accuracy |
yolov8x.pt |
X-Large | 🚀 | Best Accuracy |
For segmentation masks, use yolov8n-seg.pt.
Ultralytics recently released YOLOv10, offering better accuracy and faster performance.
To upgrade:
pip install -U ultralytics
Then in your code, replace:
model = YOLO("yolov8l.pt")
with:
model = YOLO("yolov10l.pt")
YOLOv10 is fully backward-compatible and uses the same API — your project will continue working with no code changes.
main.py (e.g., if box.conf > 0.4:).yolov8n.pt.Created with ❤️ using Python, Ultralytics YOLO, and OpenCV,
powered by NVIDIA GPU.