An interactive technical presentation for an industrial-grade face mask detection system, built with YuNet face detection and MobileNetV2 classification.
π Looking for the actual detection system? The Python source code (OpenCV + TensorFlow) lives at
github.com/rebeeh/Face-Mask-Detection-Python
This repository is an interactive slideshow (React/Vite SPA) that documents the architecture, data pipeline, and performance analytics of a production-grade real-time face mask detection system.
Key system metrics:
| Metric | Value |
|---|---|
| Precision | 98.2% |
| Recall | 97.5% |
| F1 Score | 0.978 |
| Inference Latency | 22ms |
| mAP@.5 | 0.962 |
The underlying ML system uses a two-stage pipeline:
Camera Frame
β
βΌ
βββββββββββββββββββββββββββββββ
β YuNet Face Detector (ONNX) β ~5ms / face
β Score threshold: 0.60 β
β NMS threshold: 0.30 β
ββββββββββββββ¬βββββββββββββββββ
β Face ROI crops
βΌ
ββββββββββββββββββββββββββββββββββββββββββββ
β Preprocessing Pipeline β
β 1. BGR β RGB color conversion β
β 2. Aspect-ratio-preserving square pad β
β 3. Resize to 224Γ224 + MobileNet norm β
ββββββββββββββ¬ββββββββββββββββββββββββββββββ
β Normalized tensor
βΌ
ββββββββββββββββββββββββββββββββββββββββββββ
β MobileNetV2 Classifier (TFLite FP16) β
β Binary: With Mask / No Mask β
β Quantized: 3.4MB β 1.8MB (47% savings) β
ββββββββββββββββββββββββββββββββββββββββββββ
Threading model: Camera I/O runs in a dedicated thread with a threading.Lock mutex, decoupling frame capture from inference to sustain 30+ FPS with 0ms input lag.
- Base images: 3,833 (1,916 masked / 1,917 unmasked) β near-perfect class balance
- Augmentations: Rotation, brightness, blur, zoom
- Training: 8 epochs Β· Binary Cross-Entropy Β· Adam optimizer
- Validation accuracy at epoch 8: 97.8%
| Technology | Purpose |
|---|---|
| React 19 + TypeScript | UI framework |
| Vite 7 | Build tool & dev server |
| TailwindCSS v4 | Utility-first styling |
| Framer Motion | Slide & element animations |
| Recharts | Training analytics charts |
| Lucide React | Icon system |
- Node.js β₯ 18
- npm β₯ 9
# 1. Clone the repository
git clone https://github.com/rebeeh/Face-Mask-Detection-Overview.git
cd Face-Mask-Detection-Overview
# 2. Install dependencies
npm install
# 3. Start the dev server
npm run devOpen http://localhost:5173 in your browser.
npm run buildThe output is written to ./dist/.
npm run previewsrc/
βββ types/
β βββ index.ts # Shared TypeScript interfaces
βββ data/
β βββ constants.ts # Chart data & code snippet constants
βββ components/
β βββ ui/
β β βββ GlassCard.tsx # Reusable frosted-glass card
β β βββ CodeBlock.tsx # Syntax-highlighted code display
β β βββ SlideContainer.tsx# Animated slide wrapper
β βββ layout/
β β βββ ProgressBar.tsx # Top progress indicator
β β βββ SideNav.tsx # Left dot-navigation
β β βββ NavControls.tsx # Bottom prev/next navigation
β βββ slides/
β βββ HeroSlide.tsx
β βββ DataSlide.tsx
β βββ StackSlide.tsx
β βββ PreprocessingSlide.tsx
β βββ YuNetSlide.tsx
β βββ AnalyticsSlide.tsx
β βββ MobileNetSlide.tsx
β βββ ThreadingSlide.tsx
β βββ OptimizationSlide.tsx
β βββ ConclusionSlide.tsx
βββ App.tsx # Root orchestrator (~90 lines)
| Action | Control |
|---|---|
| Next slide | β Arrow / Space |
| Previous slide | β Arrow |
| Jump to slide | Click the left sidebar dot |
This project is automatically deployed to GitHub Pages on every push to main via the workflow at .github/workflows/deploy.yaml.
Live URL: https://rebeeh.github.io/Face-Mask-Detection-Overview/
To deploy your own fork:
- Fork this repository
- Go to Settings β Pages β Source and select GitHub Actions
- Push any change to
mainβ the workflow handles the rest
MIT β see LICENSE for details.