Git Product home page Git Product logo

shantanugupta1118 / social-distancing-and-face-mask-detection Goto Github PK

View Code? Open in Web Editor NEW
35.0 7.0 22.0 34.62 MB

Social Distancing and Face Mask Detection using TensorFlow. Install all required Libraries and GPU drivers as well. Refer to README.md or REPORT for know to installation requirement

Home Page: https://shantanugupta1118.github.io/Social-Distancing-and-Face-Mask-Detection/

Python 100.00%
machine machinelearning python python3 machinelearning-python deep-neural-networks ssd-mobilenet facemask-detection socialdistancinganalyzer tensorflow

social-distancing-and-face-mask-detection's Introduction

Social Distancing and Face Mask Detection 😷

                      

                                                                        😷C O V I D - 1 9                           A L E R T!🙏

Developed By:

👉  [Shantanu Gupta]    Portfolio       GitHub      LinkedIN

About--

                  Social Distancing and Face Mask Detection Platform utilizes Artificial Network to perceive if a person walk with maintain social distance and does/doesn’t wear a mask as well. The application can be associated with any current or new IP cameras to identify individuals maintaining social distance with/without a mask. 😷

System Requirement -- 🖥️

  • SOFTWARE--      
    • Software:                 Anaconda + Python 3.x (3.8 or earlier)
    • Editor:                      VS Code/ PyCharm/ Sublime/ Spyder
    • Environment:          TensorFlow
    • GPU Drivers:           Nvidia® CUDA® 11.0 requires 450.x or above
                                     CUDA® Toolkit (TensorFlow >= 2.4.0)
                                     cuDNN SDK 8.0.4 (TensorFlow >= 2.4.0)
  • HARDWARE--
    • GPU:                                     Graphics Processor (NVIDIA) ̶min 2GB
    • Camera:                                CCTV/ Webcam/ Mobile Camera (Sharing Camera)
    • Storage Disk (Optional):       SSD – Min 400MB/s Read Speed

Installation Process--

  • Download Anaconda Software --
Operating System Download Link
👉 Windows click here
👉 Mac click here
👉 Linux click here

📢 During Installation be sure to check to set Environmental variable path

  • Create new Environment for the installation of libraries:
    • Open Command Prompt / Anaconda Prompt and type conda create --name tf_python
      you can set any name in place of tf_python to create a new envionment. and after type y and enter.
    • Install all required Libraries given in requirement.txt by using command pip install -r requirement.txt

Required Libraries--

File Required to Download --

  • DATASETS :
            Using datasets to train the model for Face Mask Detection model. To download the dataset -- 👉 Click here  :point_left: (Dataset with 4,000 Images Sampels) :star2:File contain 2 Sub-Folder i.e. With_mask & Without_mask (each folder contain 2k samples of images).

This is a balanced dataset containing faces with and without masks with a mean height of 283.68 and mean width of 278.77

data

  • Yolo Weights (V3) -- Pre-Trained model:
            YOLO (You Only Live Once), the pre-trained weights of the neural network are stored in yolov3.weights                                     Download the Weight File 👉 Click here 👈

Trained Result of Face Mask Model--

File Structure

Set all downloaded files to their respective folders/path as given in Folder Structure Diagram.

RUN the Main Module--

  • Using Command Prompt or Anaconda Prompt:
    • To activate environment:--      conda activate tf_python
    • Run main module:-- python main.py

Outputs--

Contribute:

                🔥 Contributions are always welcome!

Drop a ⭐ if you like this Repository.. 😄

                                                            enjoy      status

👉👉👉       []:point_left::point_left::point_left:

social-distancing-and-face-mask-detection's People

Contributors

isachinsoni avatar r-g1 avatar ravi-11 avatar shantanugupta1118 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

social-distancing-and-face-mask-detection's Issues

If getting 'str has no attribute decode'

SOLUTION APPROACHES TO RESOLVE THE OCCURED ERRORS.

try the following steps to resolve the error. one by one

  • keep updating all libraries
  • should this project use in one tensorflow environment only
  • uninstall tensorflow, keras, tensorflow-gpu by using
    - conda uninstall tensorflow
    - conda uninstall tensorflow-gpu
    - conda uninstall keras
    ,respectively

and install it again using install instead of uninstall same.
- conda install tensorflow
- conda install tensorflow-gpu
- conda install keras
after run main.py in the file directory using python main.py

Thank you.
if it doesn't work then REPLY below

Error issue

Traceback (most recent call last):
File "main.py", line 1, in
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input
ModuleNotFoundError: No module named 'tensorflow'

This error is displaying while running the program. Could u please solve this

error while running the project

Screenshot (101)

while running the main.py I got this type of error sir would you please help me sir

FAILED: fs.is_open(). Can't open "models/deploy.prototxt" in function 'cv::dnn::ReadProtoFromTextFile'

speed

hello Shantanugupta1118 i need a help ,everything working but speed is very flow plz help me
telegram user name gokulite ... plese ping me

If getting readNetFromDark import/parsing error

  • Check your OpenCV version should not be less than 4.4.0
  • If your version is 4.4.0 < then update all libraries
  • try to use OpenCV version 4.4.0 and update OpenCV/cuDNN libraries.
  • Install properly cuDNN CUDA GPU library

Error in train_mask_detector.py

Hi @Shantanugupta1118 ,

I have meet an error wile running the module1 (train_mask_detector.py). The error occurs after training the mask at the last steps:

[INFO] saving mask detector model...
Traceback (most recent call last):
File "E:\New folder\train_mask_detector.py", line 144, in
model.save(args["model"], save_format="h5")
File "C:\Users\MY HP\AppData\Roaming\Python\Python39\site-packages\keras\utils\traceback_utils.py", line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File "C:\Users\MY HP\AppData\Roaming\Python\Python39\site-packages\h5py_hl\files.py", line 533, in init
fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
File "C:\Users\MY HP\AppData\Roaming\Python\Python39\site-packages\h5py_hl\files.py", line 232, in make_fid
fid = h5f.create(name, h5f.ACC_TRUNC, fapl=fapl, fcpl=fcpl)
File "h5py_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py\h5f.pyx", line 126, in h5py.h5f.create
OSError: [Errno 22] Unable to create file (unable to open file: name = 'classifier.model', errno = 22, error message = 'Invalid argument', flags = 13, o_flags = 302)

image

How can i solve it? Thanks.

please provide a video on this project sir

Shantanu Gupta sir would you please provide a video on this project sir based on how to install the required libraries
and also how to run this project sir pls make a full length video sir

Speed problem

Hi @Shantanugupta1118 ,

Can I get your help on the speed problem?
The project is great and all everything is going well, but it's just the speed is very slow or lagging while running.
What can i do? Thanks.

error after running

(tf_python) C:\Users\Srikant\Social-Distancing-and-Face-Mask-Detection-main>python main.py
2022-02-23 11:52:21.029770: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2022-02-23 11:52:21.029984: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.

No weight file

I tried to run this repo but couldn't run without the weight file.

weightsPath = "yolo-coco/yolov3.weights"

There was no yolov3.weights file, could you please share it again?
Thank you

data_desc.py

Where is the data_desc.py file ?
And while installation of requirement .txt
It's showing in anaconda prompt that ..file does not exist .
That means where should I upload files in anaconda prompt???

IndexError: invalid index to scalar variable.

File "C:\Users\Refresh\SDFM\main.py", line 61, in
ln = [ln[i[0] - 1] for i in net.getUnconnectedOutLayers()]
File "C:\Users\Refresh\SDFM\main.py", line 61, in
ln = [ln[i[0] - 1] for i in net.getUnconnectedOutLayers()]
image

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.