HyperAI

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

2 years ago
Information
Jiaxin Sun
特色图像

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.

Amazon social distance assistant diagram Red circle on the left: Warning, these employees, spread out Green circle on the right: Safe distance, continue to maintain

Read previous reports:

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:

https://openbayes.com/console/open-tutorials/containers/Qgf0mAml82l

DeepSOCIAL paper interpretation:

Crowd Distance Monitoring DeepSOCIAL The most complete Chinese paper + source code guide

https://arxiv.org/pdf/2008.11672.pdf

Project code details

This tutorial mainly demonstrates:

  1. Compile YOLO
  2. 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
Add a caption for the image, no more than 140 characters (optional)

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

Add a caption for the image, no more than 140 characters (optional)
Add a caption for the image, no more than 140 characters (optional)

To view the complete code, please visit:

https://openbayes.com/console/open-tutorials/containers/Qgf0mAml82l

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

Add a caption for the image, no more than 140 characters (optional)

To view the complete code, please visit:

https://openbayes.com/console/open-tutorials/containers/Qgf0mAml82l

7. Reasoning process

Add a caption for the image, no more than 140 characters (optional)

8. Results presentation

show_video('/openbayes/home/darknet/DeepSOCIAL_Crowd_Map.mp4')
Add a caption for the image, no more than 140 characters (optional)
show_video('/openbayes/home/darknet/DeepSOCIAL_DTC.mp4')
Add a caption for the image, no more than 140 characters (optional)
show_video('/openbayes/home/darknet/DeepSOCIAL_Social_Distancing.mp4')
Add a caption for the image, no more than 140 characters (optional)

To view the full notebook, visit:

https://openbayes.com/console/open-tutorials/containers/Qgf0mAml82l

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:

https://openbayes.com/console/open-tutorials/containers/Qgf0mAml82l

If you want to learn any interesting tutorials, please leave a message to tell us~

-- over--