Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added table #116

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 39 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1> Face Recognition Project </h1>
# FaceRec - Face Recognition Project

**FaceRec** is an innovative face recognition project utilizing **Flask**, **FastAPI**, **DeepFace**, and **MongoDB** to create a Face recognition system. This application empowers users to register faces along with associated metadata, update their information, and delete their data, creating a comprehensive face recognition system.
**FaceRec** is an innovative face recognition project utilizing **Flask**, **FastAPI**, **DeepFace**, and **MongoDB** to create a face recognition system. This application allows users to register faces with associated metadata, update their information, and delete data, providing a comprehensive face recognition solution.

<p align="center">
<a href="https://github.com/devansh-shah-11/FaceRec/actions/workflows/python-app.yml"><img src="https://github.com/devansh-shah-11/FaceRec/actions/workflows/python-app.yml/badge.svg" alt="Python application"></a>
Expand All @@ -13,7 +13,6 @@
<a href="https://sonarcloud.io/dashboard?id=Devasy23_FaceRec"><img src="https://sonarcloud.io/api/project_badges/measure?project=Devasy23_FaceRec&metric=ncloc" alt="Lines of Code"></a>
<a href="https://sonarcloud.io/dashboard?id=Devasy23_FaceRec"><img src="https://sonarcloud.io/api/project_badges/measure?project=Devasy23_FaceRec&metric=security_rating" alt="Security Rating"></a>
<a href="https://sonarcloud.io/dashboard?id=Devasy23_FaceRec"><img src="https://sonarcloud.io/api/project_badges/measure?project=Devasy23_FaceRec&metric=sqale_rating" alt="Sqale Rating"></a>
<!-- <a href="https://sonarcloud.io/dashboard?id=Devasy23_FaceRec"><img src="https://sonarcloud.io/api/project_badges/measure?project=Devasy23_FaceRec&metric=coverage" alt="Coverage"></a> -->
<a href="https://sonarcloud.io/dashboard?id=Devasy23_FaceRec"><img src="https://sonarcloud.io/api/project_badges/measure?project=Devasy23_FaceRec&metric=sqale_index" alt="Sqale Index"></a>
<a href="https://sonarcloud.io/dashboard?id=Devasy23_FaceRec"><img src="https://sonarcloud.io/api/project_badges/measure?project=Devasy23_FaceRec&metric=reliability_rating" alt="Reliability Rating"></a>
<a href="https://sonarcloud.io/dashboard?id=Devasy23_FaceRec"><img src="https://sonarcloud.io/api/project_badges/measure?project=Devasy23_FaceRec&metric=vulnerabilities" alt="Vulnerabilities"></a>
Expand All @@ -22,10 +21,20 @@
## 🚀 Features

- **Real-Time Face Recognition:** Detect and recognize faces seamlessly in real-time.
- **User-Friendly Interface:** Easy to use with a clean design for enhanced user experience.
- **User-Friendly Interface:** Clean design for enhanced user experience.
- **Metadata Management:** Register, update, and delete face entries with ease.
- **Scalable Architecture:** Built to handle multiple users and extensive datasets.

## 📊 Repository Statistics

| Metric | Badge | Link |
|-------------------------|-------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|
| **Stars** | ![GitHub Stars](https://img.shields.io/github/stars/Devasy23/FaceRec?style=social) | [Stars](https://github.com/Devasy23/FaceRec/stargazers) |
| **Forks** | ![GitHub Forks](https://img.shields.io/github/forks/Devasy23/FaceRec?style=social) | [Forks](https://github.com/Devasy23/FaceRec/network/members) |
| **Open Issues** | ![GitHub Issues](https://img.shields.io/github/issues/Devasy23/FaceRec) | [Issues](https://github.com/Devasy23/FaceRec/issues) |
| **Open Pull Requests** | ![GitHub PRs](https://img.shields.io/github/issues-pr/Devasy23/FaceRec) | [Pull Requests](https://github.com/Devasy23/FaceRec/pulls) |
| **Closed Pull Requests**| ![GitHub Closed PRs](https://img.shields.io/github/issues-pr-closed/Devasy23/FaceRec) | [Closed PRs](https://github.com/Devasy23/FaceRec/pulls?q=is%3Apr+is%3Aclosed) |

## 📦 Getting Started

These instructions will guide you through setting up the project on your local machine for development.
Expand Down Expand Up @@ -53,93 +62,81 @@ Make sure you have **Python 3.10 or later** installed.

### Running the Server

To start the Flask and FastAPI applications, run the following command:
To start the Flask and FastAPI applications, run:
```bash
python main.py
```

Your application will be available at `http://localhost:5000`.

<details>
<summary> <span style="font-size: 1.5em;"><strong>Project Structure</strong></span></summary>
<summary><strong>Project Structure</strong></summary>

- `requirements.txt`: Contains the Python dependencies for the project.
- `API/`: Contains the code for the FastAPI application.
- `FaceRec/`: Contains all files related to the HTML, CSS, and Flask application.
- `Model-Training/`: Contains scripts for training models.
- `docs/`: Contains documentation files.
- `test-faces/`: Contains test data for face recognition.
- `main.py`: Contains code to start both FastAPI and Flask applications.
- `API/`: FastAPI application code.
- `FaceRec/`: HTML, CSS, and Flask application files.
- `Model-Training/`: Scripts for model training.
- `docs/`: Documentation files.
- `test-faces/`: Test data for face recognition.
- `main.py`: Code to start FastAPI and Flask applications.

</details>

## Function Flow

1. `create_new_faceEntry()`: Receives a POST request with an image and metadata. It extracts the face, calculates the embeddings, and stores the data in the database.
2. `Data()`: Sends a GET request to the `/data` endpoint of the FastAPI app to get the list of Face Entries from MongoDB.
3. `update()`: Updates the details of the face entry in the database.
4. `read()`: Sends a GET request with a specific `Employeecode` to read the related information.
5. `delete()`: Deletes the specific employee data.

## Sequence Diagram

![image.png](sequence-diagram.png)


## 🗄️ Database Schema

1. **Create a New Connection in MongoDB** using the following URL:
1. **Create a New MongoDB Connection** using:
```
mongodb://localhost:27017/8000
```

2. **Create a Database:**
2. **Database Details:**
- **Database Name**: `DatabaseName`
- **Collection Name**: `CollectionName`

3. **Import Data by Using a JSON File:**
3. **Import Data**:
- From the `database.mongo` folder -> `{DatabaseName}.{CollectionName}.json`

### The `faceEntries` Collection Schema:

- `id`: A unique identifier for the face entry.
- `Employeecode`: A unique employee ID associated with the image.
- `Name`: The name of the person in the image.
- `gender`: The gender of the person.
- `Department`: The department of the person.
- `time`: The timestamp of when the face entry was created.
- `embeddings`: The embeddings of the face image.
- `id`: Unique identifier for the face entry.
- `Employeecode`: Unique employee ID associated with the image.
- `Name`: Person's name.
- `Gender`: Gender of the person.
- `Department`: Department of the person.
- `time`: Timestamp of the face entry creation.
- `embeddings`: Embeddings of the face image.
- `Image`: Base64 encoded image file.

## 🔄 Function Flow

1. **`create_new_faceEntry()`**: Receives a POST request with an image and metadata. It extracts the face from the image, calculates the embeddings, and stores the data in the database.

2. **`Data()`**: Sends a GET request to the `/data` endpoint of the FastAPI app to retrieve the list of face entries from MongoDB.

1. **`create_new_faceEntry()`**: Receives a POST request with an image and metadata, extracts the face, calculates embeddings, and stores data in the database.
2. **`Data()`**: Sends a GET request to the `/data` endpoint to retrieve the list of face entries from MongoDB.
3. **`update()`**: Updates the details of a face entry in the database.

4. **`read()`**: Sends a GET request with a specific `Employeecode` to retrieve related information.

5. **`delete()`**: Deletes a specific employee's data from the database.
5. **`delete()`**: Deletes specific employee data from the database.

## 🧪 Testing

To run the tests for this project, use the following command:
To run the tests:
```bash
pytest
```

## 👥 Our Valuable Contributors ❤️✨
Thanks to all the amazing people who have contributed to **FaceRec**! 💖

[![Contributors](https://contrib.rocks/image?repo=Devasy23/FaceRec)](https://github.com/Devasy23/FaceRec/graphs/contributor)
[![Contributors](https://contrib.rocks/image?repo=Devasy23/FaceRec)](https://github.com/Devasy23/FaceRec/graphs/contributors)

## 📄 Documentation

For detailed API documentation, please refer to the [API Documentation](API_DOCUMENTATION.md) file.

For detailed API documentation, refer to the [API Documentation](API_DOCUMENTATION.md) file.

## 📄 License

This project is licensed under the **APACHE License** - see the [LICENSE](LICENSE) file for details.

This project is licensed under the **Apache License**. See the [LICENSE](LICENSE) file for details.