Downloads · 30 days
20
18% of all-time downloads
maftuh-main/meme-emotion-detector
meme-emotion-detector is a machine learning model from maftuh-main. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
TFLite model untuk deteksi ekspresi wajah real-time dengan 7 emosi.
Downloads · 30 days
20
18% of all-time downloads
All-time downloads
110
Public
Repo size
1.4 MB
Likes
0
Public
Click a slice to open those files.
.tflite1.4 MB · 100%
From the Hugging Face model README
TFLite model untuk deteksi ekspresi wajah real-time dengan 7 emosi.
from huggingface_hub import hf_hub_download
import tensorflow as tf
import numpy as np
# Download model
model_path = hf_hub_download(
repo_id="maftuh-main/meme-emotion-detector",
filename="model.tflite"
)
# Load TFLite model
interpreter = tf.lite.Interpreter(model_path=model_path)
interpreter.allocate_tensors()
# Get input/output details
input_details = interpreter.get_input_details()
output_details = interpreter.get_output_details()
# Prepare image (48x48 grayscale, normalized)
# face_img = ... (your face image)
# face_resized = cv2.resize(face_img, (48, 48))
# face_gray = cv2.cvtColor(face_resized, cv2.COLOR_BGR2GRAY)
# face_input = face_gray.astype(np.float32) / 255.0
# face_input = np.expand_dims(face_input, axis=[0, -1])
# Run inference
# interpreter.set_tensor(input_details[0]['index'], face_input)
# interpreter.invoke()
# predictions = interpreter.get_tensor(output_details[0]['index'])[0]
# Get emotion
emotions = ['angry', 'disgust', 'fear', 'happy', 'sad', 'surprise', 'neutral']
# emotion_idx = np.argmax(predictions)
# detected_emotion = emotions[emotion_idx]
Model trained on FER2013 dataset atau custom facial expression dataset.
model.tflite - TensorFlow Lite model (1.4 MB)MIT License