Skip to content

This repository provides a user-friendly tool for face mask detection using the powerful YOLOv8 object detection model and the interactive Streamlit framework. It enables real-time detection of faces and masks in images and videos, showcasing the capabilities of deep learning in practical applications.

Notifications You must be signed in to change notification settings

dinosptr/facemask-detection

Repository files navigation

Real-Time Face Mask Detection with Streamlit and YOLOv8

How to Run Locally

System Requirements

  • Operating System: Windows, MacOS, or Linux
  • Python 3.10
  • Git
  • Disk Space: At least 3GB of available disk space

Pre-Installation Checks

  1. Check Python Installation:

    • Open Command Prompt (cmd).
    • Check if Python is installed by running:
    python --version
    • If Python is not installed, download and install from python.org. Make sure to choose a version compatible with your operating system.
  2. Check Git Installation:

    • Check if Git is installed by running:
      git --version
    • If Git is not installed, download and install from git-scm.com.

Installation Steps

3. Navigate to Project Folder via Command Prompt:

  • Change the current directory to your project folder using the cd command.

4. Create Virtual Environment and Project Folder:

  • Create a new folder named "facemaskdetection-project" using the following command:
    mkdir facemaskdetection-project
  • Navigate to the "facemaskdetection-project" folder:
    cd facemaskdetection-project
  • Create a new Python virtual environment named "facemaskEnv" using the following command:
    python -m venv facemaskEnv 
    or
    py -m venv facemaskEnv
    • Activate the virtual environment:
      • On Windows:
        .\facemaskEnv\Scripts\activate
      • On MacOS/Linux:
        source facemaskEnv/bin/activate

Now you have set up the project folder named "facemaskdetection-project" with a Python virtual environment named "facemaskEnv". Next, proceed with the remaining installation steps within this project folder.

5. Clone Project Files:

  • Clone the project repository containing notebook files, models, and Streamlit script from GitHub with the following command:
    git clone https://github.com/dinosptr/facemask-detection.git
  • Navigate to the cloned repository folder:
    cd facemask-detection

6. Install Project Dependencies:

  • Install the project's required dependencies using pip and the provided requirements.txt file:
    pip install -r requirements.txt

7. Run the Streamlit App:

To launch the Streamlit application, execute the following command in the project directory:

streamlit run Welcome.py

After the command to run the Streamlit script, a new line is added informing the user that they will be directed to open the app in their web browser at localhost:8501.

8. Tampilan Website

Alt text Alt text

Contoh output Image

Alt text Alt text

About

This repository provides a user-friendly tool for face mask detection using the powerful YOLOv8 object detection model and the interactive Streamlit framework. It enables real-time detection of faces and masks in images and videos, showcasing the capabilities of deep learning in practical applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published