A focused, user-friendly desktop application (Tkinter) for running inference with YOLO .pt models on images, videos, or a webcam. This README covers only the desktop app and how you can use your own YOLO model for testing.
- Overview
- Features
- Installation
- Usage
- Using Your Own YOLO Model
- Project Structure
- Examples
- Troubleshooting
- License & Acknowledgments
This is a desktop application for fast, visual testing of YOLO models. It’s designed for local use on your machine (images, videos, webcam) and makes it easy to switch models, tweak thresholds, and save annotated outputs — no training steps, no cloud required.
- Dark-themed Tkinter GUI optimized for desktop
- Load images, videos, or use webcam for real-time detection
- Dynamic model loading: swap
.ptmodels at runtime - Auto-detects class names and number of classes from the model
- Adjustable confidence & IoU thresholds
- Save annotated images (in
runs/detect/predict*by default) - Simple, clear visual results: counts, per-class summaries, confidence bars
- Python 3.9+
- pip
- (optional) Webcam for real-time testing
git clone https://github.com/drisskhattabi6/YOLO-Object-Detection-GUI-APP
cd YOLO-Object-Detection-GUI-APPLinux / macOS
python3 -m venv venv
source venv/bin/activateWindows (PowerShell)
python -m venv venv
venv\Scripts\activateYou should see (venv) in your terminal when it’s active.
pip install -r requirements.txtMain dependencies
ultralytics— run YOLO inference from.ptmodelsopencv-python— image/video processingpillow— image handling for GUInumpy— numerical operations
Ensure the virtual environment is active, then:
python app.py- Launch app — it will try to auto-load
models/default_yolo.pt. - Use Change Model to load any
.ptmodel from disk. - Choose input: Image, Video, or Webcam.
- Adjust Confidence and IoU sliders as needed.
- Click Detect Objects.
- Save annotated output with Save Result.
This app is designed for testing any Ultralytics-style .pt YOLO model. No code edits needed in the typical case — just place your model in models/ and load it.
Brief Answers
-
Different YOLO Version? ✅ YES — if the model is in Ultralytics
.ptformat (works with modern Ultralytics outputs).- Supported (Ultralytics
.pt): YOLOv5, YOLOv8, YOLOv9, YOLOv10, YOLOv11 — ✅ - Not supported directly: YOLOv3 / YOLOv4 in Darknet
.weights/.cfgformat — ❌ (convert to Ultralytics.ptfirst)
- Supported (Ultralytics
-
Model trained on the same dataset (Pascal VOC) but different run/size? ✅ YES — different checkpoints, sizes (nano/s/m/l), or hyperparameter variants will work without changes.
-
Model trained on a different dataset (COCO, custom)? ✅ YES — generally no code changes required. The app reads class names from the model file.
Notes
- The
voc_classesarray in code is documentation only and not required for inference. - The app will auto-detect number of classes and their names from the loaded model and display them.
- If you have a Darknet model, convert it into an Ultralytics-compatible
.ptbefore using the app.
Current structure (desktop-app focused):
YOLODetectorApp/
├── app.py
├── models/
│ └── default_yolo.pt
├── test_images/
├── README.md
└── requirements.txt
-
Model fails to load
- Ensure the file is an Ultralytics
.ptmodel. - Try re-saving or exporting the model with Ultralytics if it was converted.
- Ensure the file is an Ultralytics
-
Too many false positives
- Increase confidence threshold (e.g., 0.4–0.6).
-
Missing detections
- Lower confidence threshold (e.g., 0.15–0.25) or check that class names match expected classes.
-
Webcam problems
- Check camera is not used by another app and that permissions are granted.
- Provided for educational purposes.
- Thanks to Ultralytics, OpenCV, and Pillow for their libraries.



