Skip to content

dvirsimhon/OpenCovid

Repository files navigation



😷 COVID-19 use cases powered by computer vision platform.

for more information click here.

Description

Today, unfortunately, everyone is familiar with the term "social distance". It's something we will have to live with for a while until everything returns to normal. I have developed an application using the TensorFlow Object Detection API for identifying and measuring the social distance between pedestrians. We will detect pedestrians and calculate the distance between them. We have used the YoloV5 and Faster R-CNN models and we created some functions to improve the visualization of our predictions.

Also we'll build an automatic systems to detect people wearing masks are becoming more and more important for public health. Be it for governments who might want to know how many people are actually wearing masks in crowded places like public trains; or businesses who are required by law to enforce the usage of masks within their facilities.

This projects aims to provide an easy framework to set up such a mask detection system with minimal effort. We provide a pre-trained model trained for people relatively close to the camera which you can use as a quick start option.

But even if your use case is not covered by the pre-trained model, training your own is also quite easy (also a reasonable recent GPU is highly recommended) and a you should be able to do this by following the short guide provided in this README.

⚠️ Prerequisites

📦 How To Install

You can modify or contribute to this project by following the steps below:

0. The pre-trained model can be downloaded from here.

for windows platform download weights: frcnn , yolo

# pretrained YoloV5 model
$> cd yolomask/weights
$> bash download_weights.sh

# pretrained Faster R-CNN model
$> cd rcnn/weights
$> bash download_weights.sh

1. Clone the repository

  • Open terminal ( Ctrl + Alt + T )

  • Clone to a location on your machine.

# Clone the repository with all submodules
$> git clone --recurse-submodules https://github.com/dvirsimhon/OpenCovid.git  

# to update submodules HEAD 
$>git submodule update --remote --merge 

# Navigate to the directory 
$> cd OpenCovid

2. Install Dependencies

All the needed python packages can be found in the requirements.txt file.

# install requirments
$> pip install -U -r requirements.txt

💽 Face-Mask Dataset

1. Image Sources

2. Image Annotation

  • YOLO: Images were annotated using Yolo_mark.
  • FRCNN: Images were annotated using xml and csv format

3. Dataset Description

  • Dataset is split into 2 sets:
Set Number of images Objects with mask Objects without mask
Training Set 2340 9050 1586
Validation Set 260 1005 176
Total 2600 10055 1762

📃 Usage

🔌 Pre-trained models

# install requirments
$> python main.py --source 0         # webcam
                           file.jpg  # image 
                           file.mp4  # video
                  --mask-pt yolomask.pt # masks model.pt path(s)
                  --person-pt yolov5s.pt # person model.pt path(s)
                  --dists  # disable social distancing analyze
                  --persons # disable persons analyze
                  --masks # disable masks persons analyze
                  --show-inf # disable show inference on frame
                  --rate # display rate speed in ms
                  --project OpenCoVid # project name

Results:

📏 Social Distancing Detector

😷 Face-Mask Detector

🚦 Evaluation:

All results can be found on 🚀 Weights&Baises Logging platform here.


⌨ Scripts:

  • main.py - runs main application

Team Members:

Name Username Contact Info
Avihai Serfati serfati [email protected]
Assaf Attias attiasas93 [email protected]
Dvir Simhon dvirsimhon [email protected]

Team Supervisor: Prof. Guy Shani

⚖️ License

This program is free software: you can redistribute it and/or modify it under the terms of the MIT LICENSE as published by the Free Software Foundation.

⬆ back to top

author Serfati

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published