A collection of computer vision projects built with Python and OpenCV, covering real-time face detection, face recognition, motion-based security systems, and an AI voice assistant. All projects run locally using a webcam or image input.
Real-time face detection from a live webcam feed using OpenCV's Haar cascade classifier.
- Captures live video stream
- Detects faces frame-by-frame using
haarcascade_frontalface_default.xml - Draws bounding rectangles around detected faces
- Prints detection alerts to console
A trained face recognition model that identifies individuals from images or live input.
Training (face_train.py):
- Loads images from the
images/folder (organised by person) - Extracts facial features using OpenCV
- Trains a recognition model and saves it to
face_trained.yml
Recognition (face_detect.py):
- Loads the trained model
- Detects and identifies a face in a test image
- Returns the predicted label and confidence score
Subjects trained on: Messi, Elon, Bezos, Ryan Reynolds, Canu
A motion-sensitive security system that triggers an alert when movement is detected.
- Compares consecutive webcam frames to detect movement
- Triggers a siren audio file (
siren.wav) or system beep on motion detection - Runs continuously until manually stopped
A voice-activated assistant using Vosk for offline speech recognition.
- Listens for voice commands via microphone
- Handles commands such as playing YouTube videos and fetching Wikipedia summaries
- Uses pyttsx3 for text-to-speech responses
Prepares training data for an NLP intent classification model.
- Loads intent patterns from
intent.json - Processes and labels patterns for machine learning training
| Area | Libraries |
|---|---|
| Computer Vision | OpenCV (cv2) |
| Face Recognition | OpenCV LBPH Recognizer |
| Speech Recognition | Vosk |
| Text-to-Speech | pyttsx3 |
| Audio | simpleaudio, winsound |
| Web Automation | pywhatkit |
| Information Retrieval | wikipedia |
| Data Processing | NumPy, scikit-learn |
pip install opencv-python numpy scikit-learn vosk pyttsx3 simpleaudio pywhatkit wikipediapython face_train.pypython face_detect.pypython newsecurity.pypython "New Ai.py"computer_vision/
├── images/ # Training images organised by person
│ ├── Messi/
│ ├── Elon/
│ ├── Bezoz/
│ ├── Ryan/
│ └── Canu/
├── Face Recognition.py # Real-time face detection (webcam)
├── New Ai.py # Voice assistant
├── alert.py # Face detection with console alerts
├── face_detect.py # Face recognition inference
├── face_train.py # Face recognition model training
├── haarcascade_frontalface_default.xml # Haar cascade classifier
├── import cv2.py # Basic face detection script
├── intent.json # Intent patterns for NLP training
├── model_train.py # Intent classifier data preparation
├── newsecurity.py # Motion detection with audio alert
└── security.py # Motion detection with system beep
A separate real-time object detection project using YOLOv8 and the COCO dataset was developed in Google Colab. It covers custom model training, multi-object recognition across diverse categories, and live webcam inference. The Colab notebook will be linked here once published.
Olaniyan Taslim — github.com/Asiwaju24