giuliotripi / StopCrowd

Detect and signal groups of people in a scene that are too close to each other. Useful in a COVID-19 scenario
Other
1 stars 1 forks source link

Stop Crowd

Stop Crowd is an application that aims to detect and signal groups of people in a scene that are too close to each other. This functionality could be used in public places to automatically discover gatherings and signal them to someone (e.g. law enforcement or private security). This is important in the actual scenario to try to stop the spread of COVID-19.

This work is based on Niantic, Inc.'s footprints work Footprints and Free Space from a Single Color Image (paper, repository) and on Ross Wightman's PoseNet PyTorch implementation of the Google TensorFlow.js Posenet model (repository)

Footprints

Footprints is a method for estimating the visible and hidden traversable space from a single RGB image

This method predicts the hidden ground geometry and extent from a single image and estimate the depth:

Web version of figure 1

⚙️ Setup

The code and models were developed with PyTorch 1.3.1. The environment.yml and requirements.txt list our dependencies.

We recommend installing and activating a new conda environment from these files with:

conda env create -f environment.yml -n footprints
conda activate footprints

🖼️ Prediction

We use handheld as a model trained on handheld stereo footage with a resolution of 256x448.

We provide code to make predictions for a single image, a whole folder of images or a video. Model will be automatically downloaded when required, and input images will be automatically resized to the correct input resolution.

You can run the following commands from the root of the project.

Single image prediction:

python predict.py --image test_data/cyclist.jpg

Multi image prediction:

python predict.py --image test_data

By default, .jpg visualisations will be saved to the predictions folder; this can be changed with the --save_dir flag.

Command line arguments

The are many optional command line arguments that allows to change the program behaviour:

Training & more informations

The instructions on how to train the model and more info about footprints are available in the project repository.