An open API service indexing awesome lists of open source software.

https://github.com/nothing-dot-exe/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.
https://github.com/nothing-dot-exe/advanced-product-detection-gpu-powered

ai ml ml-project real-time tranding web-cam

Last synced: about 2 months ago
JSON representation

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.

Awesome Lists containing this project

README

          

# ๐Ÿง  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

- โšก **GPU-powered (CUDA)** for real-time inference
- ๐Ÿงฉ Detects **all COCO objects** (bottles, laptops, phones, fruits, etc.)
- ๐Ÿšซ Automatically ignores **person (human)** class
- ๐ŸŽจ Random **color-coded bounding boxes** per product
- ๐Ÿ–ฅ๏ธ Works on **webcam or video files**
- ๐Ÿ”ง Built using **latest Ultralytics YOLO (v8 or v10)**

---

## ๐Ÿ“ Folder Structure

```
hand_product/
โ”‚
โ”œโ”€โ”€ main.py # Main detection script
โ”œโ”€โ”€ requirements.txt # Dependencies
โ””โ”€โ”€ README.md # Documentation
```

---

## โš™๏ธ Setup Instructions

### 1๏ธโƒฃ Create & Activate Virtual Environment
```bash
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:
```bash
pip uninstall torch torchvision torchaudio -y
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
```

Then install the rest:
```bash
pip install -r requirements.txt
```

---

## โšก Run the Detector

### โ–ถ๏ธ Webcam Mode
```bash
python main.py
```

### โ–ถ๏ธ Video File Mode
(If you add a `--source` parameter in code)
```bash
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:
```bash
pip install -U ultralytics
```

Then in your code, replace:
```python
model = YOLO("yolov8l.pt")
```
with:
```python
model = YOLO("yolov10l.pt")
```

YOLOv10 is fully backward-compatible and uses the same API โ€” your project will continue working with no code changes.

---

## ๐Ÿงช Tips

- Adjust confidence threshold in `main.py` (e.g., `if box.conf > 0.4:`).
- For faster FPS, reduce webcam resolution or use `yolov8n.pt`.
- Add custom product filters easily if you want to exclude certain categories.

---
Created with โค๏ธ using **Python**, **Ultralytics YOLO**, and **OpenCV**,

powered by **NVIDIA GPU**.

---