serengil / deepface

A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python
https://bit.ly/deepface-py
MIT License
14.93k stars 2.26k forks source link

How to use my own wights model? #618

Closed mtcdultra closed 1 year ago

mtcdultra commented 1 year ago

Hi, I'm using the MEAD dataset (https://wywu.github.io/projects/MEAD/MEAD.html) to analyze several images. I created a code to extract frames from videos and with this frames try to train using your implementation (https://github.com/serengil/tensorflow-101/blob/master/python/facial-expression-recognition.py). I´ve included line to save the h5 file. Screenshot 2022-12-14 at 16 59 38

But, it's possible to use this model in DeepFace?

By the way, I using the DeepFace to get emotions.

serengil commented 1 year ago

if your model structure satisfies this: https://github.com/serengil/deepface/blob/master/deepface/extendedmodels/Emotion.py

then you can overwrite the weights in ~/.deepface/weights

if your model structure is different, you should modify the loadModel function.