Inspiration

Imagine this. You're standing outside in the freezing cold in the bizarre weather of Canada as an employee at a grocery store or either a nurse at a hospital with the job of checking if consumers/patients have worn their masks to maintain social distancing and are following Covid protocols. To stop employees from freezing, MaskUp does the job of checking if people are wearing their masks properly.

What it does

MaskUp is an application catered towards hospitals, grocery stores, or any small businesses that require masks to be worn. Firstly, on the main page of the app, it has the option for the owners of the product to sign in to the features of the app. Once signed in, the owners would either have the option to view the live stream of the cameras in different locations or the option to view screenshots of people who haven’t worn a mask. (This feature will be talked about later). The app physically can be placed above doors, corridors, and rooms that’ll constantly check each and every individual if they are wearing a mask. If the individual is wearing a mask, it’ll show nothing on the admin page except for the individuals’ face. However, when an individual is not wearing a mask, on the admin page, it’ll show a green box with red boxes covering the mouth signifying that the individual is not wearing a mask. Now, sometimes people like to be counterproductive and argumentative believing what they are doing is correct. This correlates with people who oppose following covid protocols and maintain social distancing. For people like them, our app takes screenshots and stores it in a file which can be retractable at any given point in time which can be used for contract tracing and possibly for legal purposes if the problem escalates.

How we built it

We built the image processing part of our app first, using OpenCV-python. Our image processing algorithm detects faces and then searches for mouths on the detected faces to determine whether or not someone is wearing a mask. If someone is not wearing a mask, the algorithm will automatically take a picture. OpenCV is good for image processing but not good for GUI, so we created our GUI using PyQt5. We created a Qt widget for the video capture and then added it into our Qt application to get everything working.

Challenges we ran into

When building this project we ran into many challenges. The first major challenge we ran into was creating our mask detection algorithm. The original plan was to create our own haarcascade for OpenCV using an online dataset but the data on the dataset was not labelled for OpenCV and we did not have the time to label it ourselves. Our solution was to use a mouth detection algorithm instead of a mask detection algorithm so that we did not have to craete our own haarcascade. Another large challenge we faced was integrating OpenCV with PyQt5. Getting a webcam stream from OpenCV and displaying it in PyQt involved using a separate thread for video capture and the use of a headless OpenCV python package.

Accomplishments that we're proud of

In order for our application to properly transfer all the data from the camera to the admin page, the application would need to be extremely precise in deciding whether a person is actually wearing a mask or not.

What we learned

Throughout the entirety of the hackathon, every individual in the group learned a lot in different ways. From either setting up different python tools such as PyQt5 and PyQt5-Designer, to creating the computer vision aspect of the application which verifies when people are wearing masks or not.

What's next for Code4Covid

In the future, we would like to add the feature of measuring the temperatures of human beings entering the store to further subside the risk of spreading Covid-19 to other people. In general, the more features that are available, the closer MaskUp comes to its goal of completely avoiding any violations of Covid protocols in an enforced work environment.

Built With

Share this project:

Updates