This project is a Python PyQt5-based graphical interface that:
β
Selects between IP, RTSP, or USB cameras
β
Runs YOLOv8 object detection (supports small, medium, large models)
β
Displays human, car, and ship detections with count icons
β
Supports GPU (CUDA) or CPU inference
β
Saves user settings and last-used camera configuration
β
Includes a splash screen with configurable app logo
- β Real-time video stream from USB, IP, or RTSP cameras
- β Model switcher (YOLOv8s, YOLOv8m, YOLOv8l) for performance vs. accuracy
- β Sidebar with toggleable object detections: human, car, ship
- β Right-click on video window: toggle detection lines, change resolution (HD, FHD, 4K)
- β Menu bar: switch processing mode (CPU/GPU), change logo, save settings
- β
Configuration saved in
config.jsonfor session persistence
| Package | Version (recommended) |
|---|---|
| Python | 3.9 or 3.10 |
| PyQt5 | β₯ 5.15 |
OpenCV (opencv-python) |
β₯ 4.x |
| Ultralytics (YOLOv8) | β₯ 8.x |
| Torch (PyTorch) | GPU or CPU version (matching your hardware + CUDA if GPU) |
# Clone the repo
git clone https://github.com/m7mds91/YOLO-Detection.git
cd YOLO-Detection
# Create virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows: venv\\Scripts\\activate
# Install required packages
pip install -r requirements.txtπ Example requirements.txt
PyQt5==5.15.9
opencv-python>=4.8.0
ultralytics>=8.0.0
torch>=2.0.0π Run the app
python YOLO-Detection.pyβοΈ Configuration
Logo icon: Set/change via the menu (Settings β Change Logo)Model:
Switch via menu (Performance β YOLOv8s / YOLOv8m / YOLOv8l)
Processing device: CPU or GPU (if available)
Saved settings: Stored in config.json in the project folderπΈ Supported Cameras
| Type | Example Entry |
|---|---|
| USB Camera | 0 (default), 1, 2β¦ |
| IP Camera | (http://192.168.x.x:port/path) |
| RTSP Stream | rtsp://192.168.x.x:port/path |
π» Notes
For GPU support, ensure PyTorch with CUDA is installed matching your system and GPU drivers.
Check: PyTorch Install Guide
YOLOv8 models (.pt files) should be placed in the project directory or adjust the script paths.π Credits
YOLOv8: Ultralytics PyQt5 GUI: Riverbank Computing