# ashwin21201/the-spark-foundation-computer-vision-iot- architecture

> Architecture diagram of the GitHub repository ashwin21201/the-spark-foundation-computer-vision-iot-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ashwin21201/the-spark-foundation-computer-vision-iot-
- Repository: https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-

## Overview

This is a Jupyter-based, real-time face-mask detection project. The user prepares data and trains a CNN, then runs webcam inference: frames are captured, faces located with a Haar Cascade, and each face classified as masked or unmasked before visual feedback is drawn. The README documents these stages and the saved checkpoint; no notebook source was provided, so the graph reflects documented behavior rather than inspected calls.

Main entry points: [`ashwin's face detection.ipynb`](https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/ashwin's%20face%20detection.ipynb) (Image preparation), [`model-010.model/saved_model.pb`](https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/model-010.model/saved_model.pb) (Saved model), [`haarcascade_frontalface_default.xml`](https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/haarcascade_frontalface_default.xml) (Face detection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_prep["Image preparation"]
end

subgraph group_training["Model training"]
  node_train["CNN training"]
  node_checkpoint["Saved model<br/>[saved_model.pb]"]
end

subgraph group_inference["Live inference"]
  node_capture["Frame capture"]
  node_faces["Face detection"]
  node_classify["Mask classification"]
  node_feedback["Visual feedback"]
end

node_user(("User"))
node_dataset["Labeled images"]
node_webcam["Webcam"]

node_user -->|"runs notebook"| node_prep
node_dataset -->|"loads images"| node_prep
node_prep -->|"provides prepared data"| node_train
node_train -->|"saves checkpoint"| node_checkpoint
node_user -->|"starts detection"| node_capture
node_webcam -->|"supplies frames"| node_capture
node_capture -->|"locates faces"| node_faces
node_faces -->|"passes face regions"| node_classify
node_checkpoint -->|"classifies with"| node_classify
node_classify -->|"draws labels"| node_feedback

click node_prep "https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/ashwin's%20face%20detection.ipynb"
click node_train "https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/ashwin's%20face%20detection.ipynb"
click node_checkpoint "https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/model-010.model/saved_model.pb"
click node_capture "https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/ashwin's%20face%20detection.ipynb"
click node_faces "https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/haarcascade_frontalface_default.xml"
click node_classify "https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/ashwin's%20face%20detection.ipynb"
click node_feedback "https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/ashwin's%20face%20detection.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_prep,node_user toneBlue
class node_train,node_checkpoint toneAmber
class node_capture,node_faces,node_classify,node_feedback toneMint
class node_dataset,node_webcam toneIndigo
```

## Components

### Data preparation

- [Image preparation](https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/ashwin's%20face%20detection.ipynb): `ashwin's face detection.ipynb`

### Model training

- [CNN training](https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/ashwin's%20face%20detection.ipynb): `ashwin's face detection.ipynb`
- [Saved model](https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/model-010.model/saved_model.pb): `model-010.model/saved_model.pb`

### Live inference

- [Frame capture](https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/ashwin's%20face%20detection.ipynb): `ashwin's face detection.ipynb`
- [Face detection](https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/haarcascade_frontalface_default.xml): `haarcascade_frontalface_default.xml`
- [Mask classification](https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/ashwin's%20face%20detection.ipynb): `ashwin's face detection.ipynb`
- [Visual feedback](https://github.com/ashwin21201/the-spark-foundation-computer-vision-iot-/blob/main/ashwin's%20face%20detection.ipynb): `ashwin's face detection.ipynb`

### Other components

- **User**
- **Labeled images**
- **Webcam**

## Connections

- User → Image preparation: runs notebook (evidence: `README.md`)
- Labeled images → Image preparation: loads images (evidence: `README.md`)
- Image preparation → CNN training: provides prepared data (evidence: `README.md`)
- CNN training → Saved model: saves checkpoint (evidence: `README.md`)
- User → Frame capture: starts detection (evidence: `README.md`)
- Webcam → Frame capture: supplies frames (evidence: `README.md`)
- Frame capture → Face detection: locates faces (evidence: `README.md`)
- Face detection → Mask classification: passes face regions (evidence: `README.md`)
- Saved model → Mask classification: classifies with (evidence: `README.md`)
- Mask classification → Visual feedback: draws labels (evidence: `README.md`)
