rileykwok / Face-Recognition-Model-with-Gender-Age-and-Emotions-Estimations

Capstone Project by Bertrand Lee and Riley Kwok
90 stars 37 forks source link

Code won't run, strange dependencies #1

Open alejandrojapkin opened 6 years ago

alejandrojapkin commented 6 years ago

Code won't run, strange dependencies

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

khaledrefai commented 5 years ago

did you fix it ?

ghaidaahmed commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

HyGy commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

are there any updates for this problem ?

Sea540767145 commented 4 years ago

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 commented 4 years ago

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

this link is not working anymore

Light-- commented 4 years ago

same problem. ang solution?

bokey007 commented 4 years ago

same prob here. Anyone got yhe solution ?

KA0335 commented 4 years ago

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 commented 4 years ago

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 ?