Deep Learning-based Flask web app that predicts the Facial Expressions of users in real time, by image or image url.
I have trained a CNN model for facial expression detection with the FER2013 dataset containing 7 emotion classes ('Angry'😡 , 'Disgust'😖, 'Fear'😥, 'Happy'😄, 'Sad'😢, 'Surprise'😲, 'Neutral'🙂).
Using flask framework to build a web application.
● Python: the primary programming language used in this project to implement the CNN model, the Flask web application, and the data processing pipeline.
● TensorFlow: deep learning framework that is used to implement the CNN model for facial expression recognition.
● OpenCV: open-source computer vision library that is used for image and video processing ,capture live video feeds,and perform other image processing tasks.
● Flask: micro web framework that is used to build the web application that runs the facial expression recognition model.
● HTML/CSS/JavaScript: for building the web front-end.
• Import the required Packages and Libraries.
• explore the dataset FER-2013.
• Data analysis,Data Augmentation and Creating Training and Validation Batches.
• Create a CNN using 4 Convolutional Layers including Batch Normalization, Activation, Max Pooling, Dropout Layers followed by Flatten Layer, 2 Fully Connected dense Layers and finally Dense Layer with SoftMax Activation Function.
• Compile the model using Adam Optimizer and categorical cross entropy loss function.
• Training the model for 15 epochs and then Evaluating the model as well as saving the model Weights in .h5 Value.
• Saving the model as JSON string.
• create a Flask app to serve predictions.
• design an HTML templates for the Flask app.
• Finally we can use the model to recognize facial expressions by real time video ,from image or by image url.