Face-Recognition-Model-with-Gender-Age-and-Emotions-Estimations icon indicating copy to clipboard operation
Face-Recognition-Model-with-Gender-Age-and-Emotions-Estimations copied to clipboard

Code won't run, strange dependencies

Open alejandrojapkin opened this issue 5 years ago • 15 comments

Code won't run, strange dependencies

import src.emotionpred as emotion ModuleNotFoundError: No module named 'src.emotionpred'

alejandrojapkin avatar Oct 23 '18 21:10 alejandrojapkin

did you fix it ?

khaledrefai avatar Feb 10 '19 17:02 khaledrefai

I have the same problem when I run face_reco_demo, I think the problem from this line from face_reco_image import FaceImage

any solution?

ghaidaahmed avatar Apr 05 '19 12:04 ghaidaahmed

I was facing the same issue, so I had to comment out all code related to emotion detection models and it worked though the output was naturally lacking emotions analysis.

iuliakhomenko avatar Jul 16 '19 10:07 iuliakhomenko

I've fix it by removing that line src.emotionpred and add emotion_model_path = 'trained_models/emotion_models/fer2013_mini_XCEPTION.102-0.66.hdf5' emotion_classifier = load_model(emotion_model_path, compile=False) emotion_target_size = emotion_classifier.input_shape[1:3] emotion_offsets = (20, 40) emotion_prediction = emotion_classifier.predict(gray_face) emotion_probability = np.max(emotion_prediction) emotion_label_arg = np.argmax(emotion_prediction) emotion_text = emotion_labels[emotion_label_arg]

khaledrefai avatar Jul 16 '19 10:07 khaledrefai

I've fix it by removing that line src.emotionpred and add emotion_model_path = 'trained_models/emotion_models/fer2013_mini_XCEPTION.102-0.66.hdf5' emotion_classifier = load_model(emotion_model_path, compile=False) emotion_target_size = emotion_classifier.input_shape[1:3] emotion_offsets = (20, 40) emotion_prediction = emotion_classifier.predict(gray_face) emotion_probability = np.max(emotion_prediction) emotion_label_arg = np.argmax(emotion_prediction) emotion_text = emotion_labels[emotion_label_arg]

Can u post the full code for this please?

Just removed the line and replaced with your lines does not help.

HyGy avatar Jul 16 '19 11:07 HyGy

please check here https://github.com/khaledrefai/Face-Recognition-Model-with-Gender-Age-and-Emotions-Estimations

khaledrefai avatar Jul 16 '19 11:07 khaledrefai

please check here https://github.com/khaledrefai/Face-Recognition-Model-with-Gender-Age-and-Emotions-Estimations

Thanks. pulled the other github repo.

We got an error "cannot import name imread" from preprocessor.py

HyGy avatar Jul 16 '19 11:07 HyGy

please check here https://github.com/khaledrefai/Face-Recognition-Model-with-Gender-Age-and-Emotions-Estimations

Thanks. pulled the other github repo.

We got an error "cannot import name imread" from preprocessor.py in what file?

khaledrefai avatar Jul 16 '19 11:07 khaledrefai

are there any updates for this problem ?

marfis89 avatar Nov 03 '19 20:11 marfis89

I was facing the same issue, so I had to comment out all code related to emotion detection models and it worked though the output was naturally lacking emotions analysis.

Can you tell me how to delete that model about emotion?

Sea540767145 avatar Mar 25 '20 15:03 Sea540767145

please check here https://github.com/khaledrefai/Face-Recognition-Model-with-Gender-Age-and-Emotions-Estimations

this link is not working anymore

baddot avatar May 06 '20 22:05 baddot

same problem. ang solution?

Light-- avatar May 10 '20 02:05 Light--

same prob here. Anyone got yhe solution ?

bokey007 avatar Jun 28 '20 16:06 bokey007

from keras import models emotion_model_path = '/content/Face-Recognition-Model-with-Gender-Age-and-Emotions-Estimations/models/fer2013_mini_XCEPTION.119-0.65.hdf5' emotion_classifier = models.load_model(emotion_model_path, compile=False) emotion_target_size = emotion_classifier.input_shape[1:3] emotion_offsets = (20, 40) emotion_prediction = emotion_classifier.predict(gray_face) emotion_probability = np.max(emotion_prediction) emotion_label_arg = np.argmax(emotion_prediction) emotion_text = emotion_labels[emotion_label_arg]

Use this - U need to import models to load the .h5 file

what is gray_face?

KA0335 avatar Nov 06 '20 22:11 KA0335

I've fix it by removing that line src.emotionpred and add emotion_model_path = 'trained_models/emotion_models/fer2013_mini_XCEPTION.102-0.66.hdf5' emotion_classifier = load_model(emotion_model_path, compile=False) emotion_target_size = emotion_classifier.input_shape[1:3] emotion_offsets = (20, 40) emotion_prediction = emotion_classifier.predict(gray_face) emotion_probability = np.max(emotion_prediction) emotion_label_arg = np.argmax(emotion_prediction) emotion_text = emotion_labels[emotion_label_arg]

May I know what is gray_face ?

KA0335 avatar Nov 06 '20 22:11 KA0335