Giter Site home page Giter Site logo

thomascong121 / socialdistance Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 122.75 MB

Source code of "Towards Enforcing Social Distancing Regulations with Occlusion-Aware Crowd Detection" presented in International Conference on Control, Automation, Robotics and Vision, 2020

License: MIT License

Python 2.10% Jupyter Notebook 97.89% MATLAB 0.01%
computer-vision deep-learning object-detection

socialdistance's Introduction

SocialDistance

Keeping safe social distance is considered an effective way to avoid the spreading of coronavirus. Our SocialDistance module is a lightweight package, which provides a deep learning method for monitoring safe social distance.

Demo

Watch the demo video

Dataset

We use the video clip collected from OXFORD TOWN CENTRE dataset and made the above demo video.

We trained our detectors using data from Caltech. Moreover, we tested our model on OXFORD TOWN CENTRE, CUHK Square and Mall.

Supported Models

We have tested our model using Faster-RCNN, CenterNet, YOLO-v3 and SSD. Based on the performance of each model, we have chosen YOLO-v3 as our default model.

All pre-trained models are from Gluno CV Tookit. Besides, we have trained YOLO-v3 and SSD using data from Caltech. The trained model parameters will be available upon request. A demo on SDD/Demo shows how the training of YOLO-v3 using Caltech dataset was done.

Installation

You may be able to obtain the latest version of our model from:

pip install SDD==0.2.2.7
pip install gluoncv
pip install mxnet-cu101

Usage

After successfully installing SDD, you can use it for detection by:

from SocialDistance.utils.Run import Detect
video_path = path to your video
img_path = path to your video frames
output_path_video = path to your output video
image_groundTruth = path to your ground truth file

# YOLOv3 test
detect = Detect(pretrained_models = 'yolo_v3')
detector = detect(save_path = output_path_video, video = False, need_view_tranformer = False, device = mx.cpu())
out, TP, FP, TN, FN, extra = detector(img_path, image_groundTruth)

Running the above code will generate a labelled video. image_groundTruth is a .top file that contains the labels of social distance. We have manually labeled all three datasets and in each row of the file, the second element indicates the frame number, the third element shows the labels of social distance (0 = unsafe and 1 = safe) and the last four elements are the bounding box coordinates. The .top file of Oxford TownCenter, CUHK and Mall dataset are available under the data folder.

Support

For any issue, please contact us at:
Thomas Cong: [email protected],
Zhichao Yang: [email protected]

Citation

If you find the code/data is useful, please cite our paper:

@inproceedings{2020SSD,
    title={Towards Enforcing Social Distancing Regulations with Occlusion-Aware Crowd Detection},
    booktitle={International Conference on Control, Automation, Robotics and Vision},
    author={Cong Cong and Zhichao Yang and Yang Song and Maurice Pagnucco},
    year={2020}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.