Online Tutorial | Using DeepSOCIAL, an Internet Celebrity Project, to Monitor Social Distance

Contents at a glance:YOLO v4 is a real-time, high-precision target detection model. This tutorial will explain in detail how to implement crowd distance detection under multi-target conditions based on YOLO v4 and SORT algorithms. Keywords:YOLO v4 SORT Multi-Object Detection
At the beginning of the COVID-19 outbreak,"Maintaining social distance" has always been a "protection consensus" around the world.Whether it is the WHO's at least 3 feet (0.9 meters) or our country's 1.5-2 meters, the starting point is to reduce the risk of infection by expanding the social distance between people.
In the past three years, we have introduced the social distance warning tool released by Andrew Ng’s company – Landing AI, and also reported on the “Distance Assistant” launched by Amazon, which attracted attention because of its similarity to the circle drawn by Sun Wukong for Tang Monk. The hope is to use this tool to help employees maintain social distance.

Read previous reports:
- Andrew Ng's company released a social distance warning tool
- Amazon's "Distance Assistant" looks like the circle that Sun Wukong drew for Tang Seng.
Today we will start from the project and demonstrate how to use DeepSOCIAL, based on YOLO v4 and SORT algorithms, to track multiple targets and achieve crowd distance monitoring.
Code portal:
DeepSOCIAL paper interpretation:
Crowd Distance Monitoring DeepSOCIAL The most complete Chinese paper + source code guide
Project code details
This tutorial mainly demonstrates:
- Compile YOLO
- Reasoning process for social distance monitoring and infection risk assessment
Note:
- infer.ipynb mainly introduces the reasoning process of monitoring social distance and assessing infection risk. You can input a video of pedestrians and get the corresponding monitoring and assessment information.
- GPU is recommended for running

The following is the complete training process.
1. Prepare the code environment
# introduces dependencies from IPython.display import display, Javascript, Image from base64 import b64decode, b64encode import os import cv2 import numpy as np import PIL import io import html import time import matplotlib.pyplot as plt %matplotlib inline
2. Compile YOLO
darknet !sed -i 's/OPENCV=0/OPENCV=1/' Makefile !sed -i 's/GPU=0/GPU=1/' Makefile !sed -i 's/CUDNN=0/CUDNN=1/' Makefile !sed -i 's/CUDNN_HALF=0/CUDNN_HALF=1/' Makefile !sed -i 's/LIBSO=0/LIBSO=1/' Makefile
!make
3. Using Darknet’s Python interface


To view the complete code, please visit:
4. Use SORT algorithm to track the target in real time
!pip install filterpy from sort import * mot_tracker = Sort(max_age=25, min_hits=4, iou_threshold=0.3)
5. Input settings
Input = "/openbayes/input/input1/OxfordTownCentreDataset.avi" ReductionFactor = 2 calibration = [[180,162],[618,0],[552,540],[682,464]]
6. DeepSOCIAL parameter setting and function introduction

To view the complete code, please visit:
7. Reasoning process

8. Results presentation
show_video('/openbayes/home/darknet/DeepSOCIAL_Crowd_Map.mp4')

show_video('/openbayes/home/darknet/DeepSOCIAL_DTC.mp4')

show_video('/openbayes/home/darknet/DeepSOCIAL_Social_Distancing.mp4')

To view the full notebook, visit:
About OpenBayes
OpenBayes is a leading machine intelligence research institution in China.Provides a number of basic services related to AI development, including computing power containers, automatic modeling, and automatic parameter adjustment. At the same time, OpenBayes has also launched many mainstream public resources such as data sets, tutorials, and models.For developers to quickly learn and create ideal machine learning models.
Visit openbayes.com and register now Enjoy now 600 minutes/week on RTX 3090 And 300 minutes/week of free CPU computing time
To run the full tutorial, clickRead the original article, or visit the following link:
If you want to learn any interesting tutorials, please leave a message to tell us~
-- over--