This is just proof of concept and implemented quick hand, so don't ask to fork it and use it for your purposes.
Dataset can be either from webcam or any video from realtime showing people in public space.
Install Library
OpenCV
scipy
dlib
imutils
numpy
time
argparse
safe distance of 1 m has been considered as a norm of social distancing. Command Line execution for the realtime testing can be done bby executing-
python people_counter.py --prototxt mobilenet_ssd/MobileNetSSD_deploy.prototxt \
--model mobilenet_ssd/MobileNetSSD_deploy.caffemodel --input videos/example_01.mp4 \
--output output/output_01.avi
python people_counter.py --prototxt mobilenet_ssd/MobileNetSSD_deploy.prototxt \
--model mobilenet_ssd/MobileNetSSD_deploy.caffemodel \
--output output/webcam_output.avi
The complete code has been adapted from the pyimage search code. Hence, I offer my sincere acknowledgement to them.