Real-time object detection using YOLO11/YOLOv8 for webcams and video files. Optimized for NVIDIA GPUs with CUDA support and automatic CPU fallback.
- YOLO11 Support: Latest YOLO11 models with 10-15% better performance than YOLOv8
- GPU Accelerated: Optimized for NVIDIA GPUs with CUDA 11.8
- Real-time Detection: Webcam and video file support
- Interactive Controls: Switch models and resolutions during runtime
- Threaded Processing: 30-40% performance boost with parallel frame reading
- 10 Models Available: 5 YOLO11 models + 5 YOLOv8 models (backward compatible)
- Python 3.11+
- NVIDIA GPU with CUDA 11.8 (optional, auto-falls back to CPU)
- Webcam (for live detection)
- Clone the repository
git clone https://github.com/suteny0r/Target-Tracker.git
cd Target-Tracker- Create and activate virtual environment
# Windows
python -m venv venv
venv\Scripts\activate
# Linux/Mac
python -m venv venv
source venv/bin/activate- Install PyTorch with CUDA (for GPU acceleration)
pip install torch==2.5.1+cu118 torchaudio==2.5.1+cu118 torchvision==0.20.1+cu118 --index-url https://download.pytorch.org/whl/cu118For CPU-only:
pip install torch torchvision torchaudio- Install dependencies
pip install -r requirements.txtBasic webcam detection:
python object_detection.pyProcess video file:
python object_detection.py --video path/to/video.mp4Threaded mode (30-40% faster):
python object_detection.py --threadedGPU Benchmark mode:
python object_detection.py --no-display --threadedWhile running, use these keys:
W/S- Switch to larger/smaller model (10 models available)A/D- Decrease/increase display resolution (480p/720p/1080p)Q- Quit
yolo11n- Nano (fastest, ~100+ FPS on RTX 3090)yolo11s- Small (default on CPU)yolo11m- Mediumyolo11l- Largeyolo11x- Extra Large (default on GPU, most accurate)
yolov8nthroughyolov8x(same size variants)
Performance: YOLO11 models are ~10-15% faster and ~5-10% more accurate than YOLOv8.
Note: Models auto-download from Ultralytics on first use (~6MB to 131MB each).
--camera-index 0 Select webcam (default: 0)
--video PATH Path to video file
--imgsz 640 Model input resolution (default: 640)
--conf 0.5 Confidence threshold (default: 0.5)
--threaded Enable threaded frame reading (30-40% faster)
--no-display Benchmark mode without display
--force-cpu Force CPU mode (disable GPU)
On NVIDIA RTX 3090 with YOLO11x:
- Threaded mode: ~60-80 FPS (1080p display)
- Benchmark mode: ~100+ FPS (no display overhead)
- CPU mode: ~10-15 FPS
pyinstaller object_detection.specOutput: dist/object_detection.exe
Target-Tracker/
├── object_detection.py # Main application
├── benchmark_pure_gpu.py # GPU benchmark script
├── requirements.txt # Python dependencies
├── CLAUDE.md # Developer documentation
├── README.md # This file
└── venv/ # Virtual environment (not in git)
CUDA not detected:
- Verify NVIDIA drivers are installed:
nvidia-smi - Check CUDA 11.8 compatibility with your GPU
- Fallback to CPU mode with
--force-cpu
Low FPS:
- Use
--threadedflag - Switch to smaller model (press
S) - Reduce display resolution (press
A) - Lower
--imgszvalue
Models not downloading:
- Check internet connection
- Ultralytics will auto-download on first use
- Manual download: https://docs.ultralytics.com/
- v1.1.0 (2025-10-20): YOLO11 upgrade, 10 models available, performance improvements
- v1.0.0 (2025-10-20): Initial release with YOLOv8
See repository for license details.
- Ultralytics YOLO - YOLO11 and YOLOv8 implementation
- PyTorch - Deep learning framework
- OpenCV - Computer vision library