Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rohhn/facial-emotion-recognition
A web application to detect facial emotions based on pictures.
https://github.com/rohhn/facial-emotion-recognition
artificial-neural-networks machine-learning python sveltejs
Last synced: 19 days ago
JSON representation
A web application to detect facial emotions based on pictures.
- Host: GitHub
- URL: https://github.com/rohhn/facial-emotion-recognition
- Owner: rohhn
- Created: 2024-01-29T00:01:17.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-02-26T13:11:39.000Z (11 months ago)
- Last Synced: 2024-12-21T17:15:48.263Z (19 days ago)
- Topics: artificial-neural-networks, machine-learning, python, sveltejs
- Language: Jupyter Notebook
- Homepage: https://fer.rohand.in
- Size: 5.09 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Facial Emotion Recognition
## Introduction
This project is a facial emotion detection system that uses a convolutional neural network to detect facial emotions.
The model is trained on the [FER-2013 dataset](https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-recognition-challenge/data) which consists of 48x48 pixel grayscale images of faces with 7 different emotions:
- Angry
- Disgust
- Fear
- Happy
- Sad
- Surprise
- NeutralThe model is trained using PyTorch and the dataset is preprocessed using torchvision image transforms.
## Web Application
The web application backend is built using Flask and the front-end is created using SvelteJS.
The application allows the user to either capture an image of themselves or upload an image and the model will predict the emotion of the person in the image.The application is live and can be accessed at [https://fer.rohand.in](https://fer.rohand.in/).
## Usage
To run the models, clone the repository and run the following command in the terminal:
```shell
python -m pip install -r requirements.txt
```Then, run the following command to make a prediction on an image:
```shell
python predict.py --image-file --model-path model/SimpleCNNMdodel
```## Models
### SimpleCNNModel
This model is a simple convolutional neural network with 3 convolutional layers with ReLU activation, MaxPooling and BatchNormalization and 4 fully connected layers.
The model is trained for 3 epochs with a batch size of 32 and a learning rate of 0.001 for the Adam optimizer.
The model achieves a validation accuracy of 56%.## References
- Deploy multiple Flask applications in the same server: [here](https://towardsdatascience.com/deploy-multiple-flask-applications-using-nginx-and-gunicorn-16f8f7865497)
- SvelteJS + Flask: [here](https://cabreraalex.medium.com/svelte-js-flask-combining-svelte-with-a-simple-backend-server-d1bc46190ab9)