Skip to content

hagora30/Computer-Vision-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Face Mask Detection Project 😷

πŸ“Œ Overview

This project is a Computer Vision pipeline for:

  1. Detection: Using YOLO to detect people in a video and crop their faces.
  2. Classification: A PyTorch model trained on a Kaggle dataset to classify if a person is:
    • βœ… With Mask (label = 1)
    • ❌ Without Mask (label = 0)

The project saves cropped faces into tmp/files/, then predicts mask usage and saves results into a .csv file.


πŸ“‚ Dataset Structure

The dataset is from Kaggle: Face Mask Dataset

Organized as:

dataset/ β”œβ”€β”€ train/ β”‚ β”œβ”€β”€ with_mask/ β”‚ └── without_mask/ └── test/ β”œβ”€β”€ with_mask/ └── without_mask/

yaml Copy code


βš™οΈ Requirements

Install these libraries before running:

pip install torch torchvision
pip install opencv-python
pip install pandas
pip install matplotlib
pip install ultralytics
pip install pillow
πŸš€ How to Run
Download the dataset from Kaggle and place it in the dataset/ folder.

Run the Jupyter Notebook step by step:

Detection (YOLO): Detect people in a video β†’ crop β†’ save in tmp/files/.

Classification (PyTorch): Train classifier on dataset β†’ predict on tmp/files/.

Save predictions into predictions.csv.

Check your results in the outputs/ folder.

πŸ“Š Results
Accuracy achieved: XX% (replace with your result after training).

Example detections:

With Mask βœ…	Without Mask ❌

πŸ“¦ Project Structure
bash
Copy code
Computer Vision Project/
β”‚
β”œβ”€β”€ dataset/              # Kaggle dataset
β”œβ”€β”€ tmp/files/            # Cropped faces from YOLO
β”œβ”€β”€ outputs/              # Results (plots, sample predictions, csv)
β”œβ”€β”€ detection.ipynb       # YOLO detection notebook
β”œβ”€β”€ classification.ipynb  # Mask classification notebook
β”œβ”€β”€ requirements.txt      # Python dependencies
└── README.md             # Project documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors