Emo0.1 β Facial Emotion Recognition (FER2013)
Emo0.1 is a lightweight TensorFlow/Keras model fine-tuned on VGG16 to classify 7 facial emotions from the FER2013 dataset.
Model Details
- Input: 48x48 RGB face images
- Output:
['angry', 'disgusted', 'fearful', 'happy', 'neutral', 'sad', 'surprised']
- Framework: TensorFlow 2.x
- Training: 30 epochs with Adam (lr=0.0001)
Quick Start
Installation
pip install tensorflow opencv-python
Load Model
from huggingface_hub import hf_hub_download
from tensorflow.keras.models import load_model
model_path = hf_hub_download(repo_id="shivampr1001/Emo0.1", filename="Emo0.1.h5")
model = load_model(model_path)
Predict from Image
import cv2
import numpy as np
def predict_emotion(img_path):
img = cv2.imread(img_path)
img = cv2.resize(img, (48,48)).astype('float32')/255
pred = model.predict(np.expand_dims(img, axis=0))[0]
return ['angry','disgusted','fearful','happy','neutral','sad','surprised'][np.argmax(pred)]
File | Purpose |
---|---|
facial_EmotionClassifer.h5 |
Pre-trained Keras model |
RealTimeClassification.py |
Webcam-based emotion prediction |
predictBY_img.py |
Image-based emotion prediction |
haarcascade_frontalface_default.xml |
Haar cascade for face detection |
License Apache 2.0 Β© Shivam Prasad
- Downloads last month
- 0
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
π
Ask for provider support