Welcome to the YOLOv8 & OpenCV Computer Vision Suite. This repository houses a professional collection of computer vision implementations, bridging the gap between classical image processing techniques and state-of-the-art deep learning detection models.
From real-time security monitoring systems capable of detecting loitering in restricted zones, to interactive facial analysis tools and comprehensive object tracking benchmarks, this suite serves as both a practical toolkit and an advanced educational resource.
Located in: YOLOv8 and OpenCV built-in tracking/
A robust surveillance system designed for low-light environments.
- Real-time Person Detection: Leverages
yolov8n(Nano) for high-speed tracking on consumer hardware. - Smart Loitering Detection: Define custom polygon zones (e.g., driveways, porches). The system tracks individuals and triggers alerts if they linger beyond a set threshold (default: 5s).
- Persistent Tracking: Utilizes YOLO's native tracking capabilities to maintain subject identity across frames.
- Visual Analytics: dynamic bounding boxes, alert zone overlays, and on-screen status warnings.
Located in: Open CV/face_Detection_OpenCV.py
A modern, GUI-based application for facial analysis.
- Deep Learning Backend: Powered by OpenCV's
FaceDetectorYN(YuNet) for superior accuracy over Haar cascades. - Interactive GUI: Built with standard libraries to allow drag-and-drop image analysis and live webcam switching.
- Detailed Landmarks: Detects and visualizes 5 key facial landmarks (eyes, nose, mouth corners).
- Configurable: Adjust Confidence Threshold, NMS (Non-Maximum Suppression), and Top-K parameters in real-time.
Located in: yolov5/GetCounting.py
A lightweight, custom implementation of object tracking for counting applications.
- Centroid Tracking Algorithm: Implements a custom pure-Python centroid tracker to assign and maintain IDs.
- Video Analysis: Select any video file via system dialog to automatically count unique persons.
- Filtered Detection: Intelligent filtering based on confidence scores and bounding box size to reduce false positives.
- Real-time Visualization: Displays dynamic bounding boxes, unique IDs, and a live total count overlay.
Located in: Open CV/Object_trackeng_OpenCV.py
A comprehensive suite allowing side-by-side comparison of 7+ tracking algorithms.
- Supported Algorithms:
CSRT(High Accuracy),KCF(Fast),MOSSE(Ultra Fast),MIL,TLD,MEDIANFLOW,BOOSTING. - ROI Selection: Interactive Region-of-Interest selection to start tracking any arbitrary object.
- Performance Metrics: Real-time FPS display to evaluate tracker efficiency.
A treasure trove of essential image processing scripts:
- Panorama Stitching: Automatically stitch multiple overlapping photos into a single seamless panorama.
- Sketch Artist: Convert standard video/images into high-quality pencil sketches using bilateral filtering.
- Hough Line Detection: Detect structural lines in architectural or geometric images.
- Image Segmentation: Implement Watershed algorithm for complex object separation.
- Python 3.8+
- NVIDIA GPU (Recommended for YOLOv8 performance)
- Webcam (For live demos)
-
Clone the Repository
git clone https://github.com/yourusername/yolov5-yolov8-computer-vision-main.git cd yolov5-yolov8-computer-vision-main -
Install Dependencies
pip install numpy opencv-python ultralytics pillow torch torchvision torchaudio ipywidgets
-
Model Setup (For Face Detection)
- Download the YuNet ONNX model.
- Place
face_detection_yunet_2023mar.onnxin theOpen CV/directory.
Monitor your video feeds for suspicious activity.
cd "YOLOv8 and OpenCV built-in tracking"
# Edit the video path in the script if not using a webcam
python Live_Tracking.pyStart the GUI for image and video analysis.
cd "Open CV"
python face_Detection_OpenCV.pySelect a video file to count unique individuals.
cd yolov5
python GetCounting.pyCompare different tracking algorithms on your own footage.
cd "Open CV"
python Object_trackeng_OpenCV.pyroot/
├── YOLOv8 and OpenCV built-in tracking/ # Modern Deep Learning Tracking
│ ├── Live_Tracking.py # Main Security Script
│ └── Live_Tracking.ipynb # Jupyter Notebook demonstration
│
├── Open CV/ # Classical & DNN OpenCV Tools
│ ├── face_Detection_OpenCV.py # YuNet Face Detection GUI
│ ├── Object_trackeng_OpenCV.py # Multi-algorithm Tracker
│ ├── image_Stitching_OpenCV.py # Panorama Creator
│ ├── Pencil_sketch_conversion_OpenCV.py # Artistic Filters
│ └── ... (various utility scripts)
│
└── README.md # This file
- Web Interface: Porting the Security Tracker to a Streamlit Dashboard.
- Multi-Camera Support: Enabling simultaneous streams for larger area coverage.
- Action Recognition: Integrating Pose Estimation to detect specific behaviors (falling, running).
- Docker Support: Containerizing the application for easy deployment.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.