This repo was previously in use for real-time drowsiness detection for truck drivers. The current purpose of this repo has been shifted to object detection using a webcam using OpenCV.
This project deals with object detection using OpenCV and MobileNetSSD. The logic of the code is to loop over each frame on the webcam and detect common objects such as chair, person, etc.
$ git clone https://github.com/akshathmangudi/Object-Detection.git
$ cd Object-Detection/ - Creating a virtualvenv
- Installing dependencies
- Checking condition of webcam / video devices
- Face detection
- Object detection
- Help
For Python 3.6+ users:
python -m venv /path/to/virtualenvFor activation of virtualenv: bash/zsh:
$ source <venv>/bin/activatefish:
$ source <venv/bin/activate.fishcmd.exe:
C:\> <venv>\Scripts\activate.batPowerShell:
PS C:\> <venv>\Scripts\activate.ps1For conda users, the following commands are to be sequentially passed into your terminal:
conda -V
conda update conda
conda create -n <envname> python=x.x anaconda
conda activate <envname>For deactivation:
conda deactivate$ pip install -r requirements.txt$ system_profiler SPCameraDataType
$ system_profiler SPCameraDataType | grep "^ [^ ]" | sed "s/ //" | sed "s/://"$ python face_detect.py$ python object_detection.py --prototxt deploy.prototxt.txt --model caffedep.caffemodel"--prototxt" is the prototxt file that has information related to the machine learning model trained "--model" has the necessary information needed for detection. These two work hand in hand.
For termination of the program, press W.
$ python object_detection.py --help For taking a picture, press SPACE. For terminating the program, press ESC.
Project by Akshath Mangudi (2023)