Giter VIP home page Giter VIP logo

mask-detector's Introduction

Real-Time Face Mask Detector

Baner

CI/CD STATUS

I. Introduction

Real-Time Face Mask Detector is a project made by ลukasz Staniszewski and Bartosz Cywiล„ski for college classes. Our purpose was to create and develop application which enables to detect Covid-19 mask in real time with Client-Server socket connection architecture.

๐Ÿ‡ต๐Ÿ‡ฑ ๐Ÿ‡ต๐Ÿ‡ฑ If you want to see full documentation of project, prepared specially for college course, click here. ๐Ÿ‡ต๐Ÿ‡ฑ ๐Ÿ‡ต๐Ÿ‡ฑ

Project architecture is divided on:

  • Server - python script representing socket server, to which client can connect. After client's correct connection server is downloading in real-time frames from camera, which is connected to same (sub)system on which server is running. Server processes image by using Haar Cascades with OpenCV in order to detect face(s) in the frame and then, when face is detected, its running algorithm with pre-trained (using tensorflow) model to detect Covid-19 mask. After full processing, server sends to client frame with decision made on it and conviction in made decision.
  • Client - python script representing socket client with proper Graphical User Inteface made with QT. Client's application enables to connect to server by giving IP of server and allows user to receive detection status.

II. Folder structure

.
โ”œโ”€โ”€ ClientDetector              # code and resources for client application
โ”‚ย ย  โ”œโ”€โ”€ pyui                    # code implementing ui
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ ui                  # ui created with qt designer
โ”‚ย ย  โ”œโ”€โ”€ resources               # resources for gui
โ”‚ย ย  โ”œโ”€โ”€ config.ini              # config file to type manually server's ip and port
โ”‚ย ย  โ””โ”€โ”€ tests                   # unit tests provided for client app
โ”œโ”€โ”€ DataPacker                  # code for data sended between server and client
โ”‚ย ย  โ””โ”€โ”€ tests                   # unit tests for data packer
โ”œโ”€โ”€ DetectorExceptions          # connection exceptions code
โ”œโ”€โ”€ ServerDetector              # code and resources for server application
โ”‚ย ย  โ”œโ”€โ”€ haar-classifier         # face detection model
โ”‚ย ย  โ”œโ”€โ”€ images                  # images for tests
โ”‚ย ย  โ”œโ”€โ”€ model                   # mask-detection model
โ”‚ย ย  โ””โ”€โ”€ tests                   # unit tests provided for server app
โ”œโ”€โ”€ docs                        # folder with official polish documentation
โ”œโ”€โ”€ logs                        # folder when logs are placed
โ”œโ”€โ”€ requirements.txt            # python modules needed to be installed to run apps
โ”œโ”€โ”€ mainClient.py               # script running client app
โ””โ”€โ”€ mainServer.py               # script running server app

III. Installation

  1. In order to install app you need to stock up with Python 3.9.5 and Windows/Linux Operating System.
  2. Download repository:
git clone https://github.com/bartooo/mask-detector.git
cd mask-detector
git-lfs pull
  1. Create virtual environment and install modules:
python -m venv venv
.\venv\Scripts\activate   [on Linux: source ./venv/bin/activate]
pip install -r .\requirements.txt

IV. How to run

  1. Open two separate terminal windows and cd in both of them to folder with installed project.
  2. Activate virtual environment in both terminals:
.\venv\Scripts\activate   [on Linux: source ./venv/bin/activate]
  1. Run Server script in one of terminals:
python .\mainServer.py
  1. When server finishes running, check server name to which you will connect. In below example its DESKTOP-HT34P2E:
...
2021-07-01 15:31:10.931750: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1264]
[SERVER] Listening on DESKTOP-HT34P2E:8006...
  1. Run Client script in second terminal:
python .\mainClient.py
  1. Go to SETTINGS, type server name in correct input and TEST CONNECTION, you should see similiar result:

CORRECT SETTINGS

  1. If you see correct frame, click CHANGE SERVER.

  2. You are free to detect your mask. Go back to Main Menu and click START DETECTION.

V. Some results

  • Application correctly working.

working gif

  • Application when no face provided.

no face gif

  • Testing connection.

test connection gif

VI. Credits

Surgical Medical Mask Graphic Vector Designed By rovian1993 from Pngtree.com.

mask-detector's People

Contributors

lukasz-staniszewski avatar cywinski 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.