Advanced-Product-Detection-GPU-Powered

🧠 Advanced Product Detection (GPU-Powered)

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.


🚀 Features


📁 Folder Structure

hand_product/
│
├── main.py              # Main detection script
├── requirements.txt     # Dependencies
└── README.md            # Documentation

⚙️ Setup Instructions

1️⃣ Create & Activate Virtual Environment

python -m venv .venv
.venv\Scripts\activate       # On Windows
source .venv/bin/activate    # On Linux/macOS

2️⃣ Install Dependencies

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

⚡ Run the Detector

▶️ Webcam Mode

python main.py

▶️ Video File Mode

(If you add a --source parameter in code)

python main.py --source path/to/video.mp4

Press ESC to close the window.


🧠 How It Works

  1. Loads the latest YOLO model (yolov8l.pt or higher) on your GPU.
  2. Detects all visible objects per frame.
  3. Automatically ignores humans (person class).
  4. Draws color-coded boxes for all other products/objects with confidence scores.

Example output:

bottle 0.89
cell phone 0.91
laptop 0.84

🧰 Requirements

ultralytics>=8.3.223
opencv-python
torch>=2.3.0
torchvision
torchaudio

🖥️ Tested Hardware

Component Example
GPU NVIDIA RTX 3060 12GB
CUDA 12.1
Python 3.12
OS Windows 10 / 11

🧩 Model Options

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.


🔮 Stay Advanced — Upgrade to YOLOv10

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.


🧪 Tips


Created with ❤️ using Python, Ultralytics YOLO, and OpenCV,

powered by NVIDIA GPU.