Skip to content

A Flask-based celebrity face recognition system using an ensemble model built with TensorFlow to classify images of Iranian celebrities

License

Notifications You must be signed in to change notification settings

MahanVeisi8/Face_recognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Face Recognition Project

This repository contains the source code for a celebrity face recognition system built with Flask and TensorFlow. It leverages a pre-trained ensemble model to classify images into predefined categories of Iranian celebrities. The project demonstrates how to build, train, and deploy a machine learning model for a practical application.

Project Structure

  • preprocess and train: Contains the Jupyter Notebook for preprocessing the data and training the ensemble model.
  • static: Stores static files like CSS, images for the web app.
  • templates: Holds HTML templates for rendering the web application.
  • test: Includes test scripts or data for the application.
  • app.py: The main Flask application file for running the web server.

Quick Start

  1. Set Up Environment: Ensure Python 3.8 and pip are installed. Install the required libraries:

    pip install flask tensorflow
  2. Run the Application: Execute the Flask application by running:

    python app.py
  3. Access the Web Interface: Open a web browser and go to http://localhost:5000 to view the application.

Model Training and Evaluation

For details on data preprocessing, model training, and evaluation, refer to the preprocess and train directory. It provides comprehensive instructions on preparing the dataset, training the ensemble model, and evaluating its performance with detailed accuracy metrics.

Sample Classifications

The system can recognize the following celebrities:

Ali Daei
0: Ali Daei
Alireza Beiranvand
1: Alireza Beiranvand
Bahram Radan
2: Bahram Radan
Ebi
3: Ebi
Golshifteh Farahani
4: Golshifteh Farahani
Hayedeh
5: Hayedeh
Homayoon Shajarian
6: Homayoon Shajarian
Javad Razavian
7: Javad Razavian
Mehran Ghafourian
8: Mehran Ghafourian
Mehran Modiri
9: Mehran Modiri
Mohamad Esfehani
10: Mohamad Esfehani
Reza Attaran
11: Reza Attaran
Sahar Dolatshahi
12: Sahar Dolatshahi
Seyed Jalal Hosseini
13: Seyed Jalal Hosseini
Taraneh Alidoosti
14: Taraneh Alidoosti
Googoosh
15: Googoosh
Mohsen Chavoshi
16: Mohsen Chavoshi
Mahan Veisi
17: Mahan Veisi
Each class has been accurately predicted by the ensemble model, with an overview of each class provided in the application.

Application Architecture

This application utilizes Flask, a lightweight and versatile web framework in Python, to serve as the backend. Flask handles routing and server-side logic, including image uploads and model inference. The front end is built using HTML and CSS, providing a user-friendly interface for interacting with the application. Once set up, the application can be accessed locally through a web browser, allowing users to upload images and view the classification results in real-time.

Backend

The Flask backend is configured to handle image uploads, where uploaded images are processed and classified using the pre-trained TensorFlow model. The predictions are then sent back to the frontend.

Frontend

The frontend is designed with simplicity in mind, using basic HTML for structure and CSS for styling. It offers an intuitive layout where users can upload images to be classified, and view both the images and their predicted classes.

By running the application on your local machine, you can interact with the model directly through the web interface hosted at http://localhost:5000.

Application Performance

After launching the application, you can upload images for classification. Here’s a demonstration of the application's performance:

App Performance

Conclusion

This project showcases the integration of machine learning models into a web application, demonstrating practical deployment and interaction with a user interface. For further improvements, consider expanding the dataset, refining the model with more advanced techniques, or optimizing the web application for production environments.

License

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

About

A Flask-based celebrity face recognition system using an ensemble model built with TensorFlow to classify images of Iranian celebrities

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published