Giter VIP home page Giter VIP logo

covid-19's Introduction

Estimating worldwide social distancing during COVID-19 through Computer Vision

Generating Dataframes from Detection JSONs

From the repo's $HOME folder:

To generate Dataframes from a detection JSON when the day-night JSON is available:

python3 Analyze_All_Data/JSON_to_dataframe.py --image-json path_to_detection_JSON --day-night-json path_to_day_night_JSON --object person --cam-type image --savename filename_to_save --savedir directory_to_save_dataframes

The aforementioned command is valid when the object type concerned is people and the camera type concerned is video cameras. The object type can be changed to vehicles by changing the command line argument --object person to --object vehicle. Likewise, the camera type can be changed by replacing --cam-type image with --cam-type video.

To generate Dataframes from a detection JSON when the day-night JSON is not available:

python3 Analyze_All_Data/JSON_to_dataframe.py --image-json path_to_detection_JSON --object person --cam-type image --savename filename_to_save --savedir directory_to_save_dataframes

To generate the dataframes for object type vehicles or camera type video, changes similar to the case when day-night JSON is available can be followed.

Plotting Results

In the Visualizations folder:

To plot scatterplots of a country or US state:

python3 scatterplots.py --country=country_name
python3 scatterplots.py --state=US_state_name

To include color coded date ranges (currently supports up to 5 date intervals):

python3 scatterplots.py --country=country_name --date1=='MM_DD ', --date2='MM_DD '

Dates must be in the format 'MM_DD_' including the trailing space.

For example,

python3 scatterplots.py --country=France --date1=='05-11 '

results in this plot:

Screen Shot 2020-08-29 at 8 46 22 PM

Checking For Social Distancing Violations

  • our solution uses 2 metrics to determine violation:
    1. size of bounding boxes to determine depth difference
    2. euclidean pixel distance

We make the assumption that all bounding box heights are representative of an average person (5.4 feet), and all bounding boxes are true positives. More details can be found in the paper:

Brief description of algorithm:

  • the algorithm will first :
    1. first detect people in a scene and determine a bounding box for each person
  • take 2 bounding boxes at a time and: 2. compute depth similarity, the relative size of the bounding boxes based on the bounding box height 3. compute the euclidean pixel distance between centers of the boxes 4. multiply the depth similarity and the euclidean pixel distance
    • boxes faraway from the camera have smaller bounding boxes, and object closer to the camera have larger bounding boxes
    • in our calculation, if 2 boxes have a similar height, then both must be closer to the camera
    • if 2 boxes are very close, pixel distance will be low
    1. checking if this value is greater than 1.11 (6/5.4) determines the pairwise violation value

Screen Shot 2020-08-29 at 8 56 09 PM

Collecting raw detection data

Create a set of cronjobs to call a bash script to call the following python files, or run these in the background at your convenience on a machine with GPU: ''' detect_cars_image_cams.py detect_people_image_cams.py detect_people_video_cams.py '''

Specify pathname with all downloaded data, or alternatively, a list of cameras (camera IDs separated by newline). Optionally specify start and stop indices to limit number of cameras. Car detection script runs by downloading data from Vision server, i.e. http://vision.cs.luc.edu/~cv/videos/ and http://vision.cs.luc.edu/~cv/images/. People detection script runs locally on Argonne, but can be modified to match the car detection script. Output is saved as JSON as specified at the end of each file.

covid-19's People

Contributors

ishaghodgaonkar avatar vishnubanna avatar honeypeartea avatar subhankar48 avatar shaneallcroft avatar

Watchers

James Cloos avatar

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.