Skip to content

MayurK-cmd/mask-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

# IoT Mask & Temperature Detection Project

🚀 An IoT-powered model that combines **AI** and **hardware integration** to detect masks and monitor temperature in real time.

📋 Table of Contents
- [Introduction](#-introduction)
- [Features](#-features)
- [Tech Stack](#️-tech-stack)
- [Hardware Components](#-hardware-components)
- [Setup and Installation](#️-setup-and-installation)
- [Docker Setup](#-docker-setup)
- [Usage](#-usage)
- [Contributing](#-contributing)
- [License](#-license)

---

## 📝 Introduction
This project integrates **AI-based mask detection** with **IoT temperature sensing** to provide real-time monitoring. Using a transformer model for mask detection and Arduino for hardware interfacing, it offers an intelligent and interactive solution for safety and compliance.

---

## ✨ Features
- Real-time Mask Detection: Uses a Transformer model for high-accuracy mask detection.
- Temperature Monitoring: Measures temperature and proximity using DHT11 and ultrasonic sensors.
- LED Indicators: Provides feedback via LEDs based on the detection results.
- Seamless Integration: Bridges backend, frontend, and hardware for smooth communication.

---

## 🛠️ Tech Stack
### Backend:
- FastAPI: For serving the mask detection API.
- Python: For ML model and API development.

### Frontend:
- React: For building an interactive user interface.

### Hardware:
- Arduino Uno: To handle temperature and mask detection inputs.
- DHT11 Sensor: For temperature and humidity sensing.
- Ultrasonic Sensor: For object proximity detection.

---

## 🔌 Hardware Components
1. Arduino Uno
2. DHT11 Temperature and Humidity Sensor
3. Ultrasonic Sensor
4. ESP32/ESP8266 (optional for wireless communication)
5. LEDs (for visual indication)
6. Breadboard and Jumper Wires

---

## ⚙️ Setup and Installation

### Prerequisites:
- Install Python 3.10+
- Install Node.js for the React frontend
- Arduino IDE for programming hardware

### Clone the Repository:
```bash
git clone https://github.com/your-username/mask-temperature-detection.git
cd mask-temperature-detection

Backend Setup:

  1. Navigate to the backend folder:
    cd backend
  2. Install dependencies:
    pip install -r requirements.txt
  3. Run the FastAPI server:
    uvicorn main:app --reload

Frontend Setup:

  1. Navigate to the frontend folder:
    cd frontend
  2. Install dependencies:
    npm install
  3. Start the development server:
    npm start

Arduino Setup:

  1. Open arduino_code.ino in Arduino IDE.
  2. Connect the Arduino Uno and upload the code.
  3. Ensure proper wiring of DHT11, ultrasonic sensor, and LEDs.

🐳 Docker Setup

Prerequisites:

  • Install Docker and Docker Compose.

Build and Run the Containers:

  1. Navigate to the project directory.

  2. Build the Docker images for backend and frontend:

    docker build -t backend ./backend
    docker build -t frontend ./frontend
  3. Run the backend container:

    docker run -p 8000:8000 backend
  4. Run the frontend container:

    docker run -p 5173:5173 frontend

Access the Application:


🚀 Usage

  1. Start the Backend: Run the FastAPI server or use the Docker container.
  2. Start the Frontend: Run the React application or use the Docker container.
  3. Connect the Arduino: Ensure the Arduino is powered and connected to the system.
  4. View mask detection results and temperature readings in real time!

🤝 Contributing

We welcome contributions! Please fork the repository, create a new branch, and submit a pull request. For major changes, open an issue to discuss your ideas.


📜 License

This project is licensed under the MIT License. See the LICENSE file for details.


📧 Contact

For any queries or suggestions, feel free to reach out at [email protected].


### Changes Added:
1. Added a **Docker Setup** section with detailed steps for building and running the backend and frontend containers.
2. Included prerequisite tools for Docker in the **Setup and Installation** section.
3. Updated the **Usage** section to reference Docker.