The objective of the project is to develop algorithm to monitor the social distancing for a given recorded video or live feed as input. Once the video is analyzed, system should display number of violations and percentage of violation of social distancing in a frame.
We have developed two algorithm to detect the social distancing for provided input.
- HOG - Histogram of Oriented Gradients
- DNN - Deep Convolution Neural Network
More details about both alogorithms is explained in report.
- Python3.0 or above
- OpenCV
- Numpy
- TensorFlow
- Imutils
- Object_detection
During installation if you ran into any problem and face any below errors, try below said methods.
!pip install pycocotools
if this errors out with "ERROR: Command errored out with exit status 1:" or "error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/"
try downloading: https://visualstudio.microsoft.com/downloads/
pip install tensorflow-object-detection-api
ERROR: readme-renderer 26.0 has requirement bleach>=2.1.0, but you'll have bleach 1.5.0 which is incompatible.
try installing: pip install bleach -U --bleach==2.1.0
- Compile protobuf and install object_detection package.
%%bash
cd models/research/
protoc object_detection/protos/*.proto --python_out=.
%%bash
cd models/research
pip install .
Run the .ipynb notebook provided. In case of any change in the input video, update the path of the input video in the final cell of the notebook and perform execution of complete .ipynb notebook by restarting the kernel.
We have provided both input and output(processed) videos for reference.