Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code won't run, strange dependencies #1

Open
alejandrojapkin opened this issue Oct 23, 2018 · 15 comments
Open

Code won't run, strange dependencies #1

alejandrojapkin opened this issue Oct 23, 2018 · 15 comments

Comments

@alejandrojapkin
Copy link

Code won't run, strange dependencies

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

@khaledrefai
Copy link

did you fix it ?

@ghaidaahmed
Copy link

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?

@iuliakhomenko
Copy link

iuliakhomenko commented Jul 16, 2019

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.

@khaledrefai
Copy link

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]

@HyGy
Copy link

HyGy commented Jul 16, 2019

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.

@khaledrefai
Copy link

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

@HyGy
Copy link

HyGy commented Jul 16, 2019

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

@khaledrefai
Copy link

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?

@marfis89
Copy link

marfis89 commented Nov 3, 2019

are there any updates for this problem ?

@Sea540767145
Copy link

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?

@baddot
Copy link

baddot commented May 6, 2020

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

this link is not working anymore

@Light--
Copy link

Light-- commented May 10, 2020

same problem. ang solution?

@bokey007
Copy link

same prob here. Anyone got yhe solution ?

@KA0335
Copy link

KA0335 commented Nov 6, 2020

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
Copy link

KA0335 commented Nov 6, 2020

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests