GithubHelp home page GithubHelp logo

face-prediction's Introduction

face-prediction

real-time age, gender and emotion prediction based on livestream webcam data

pre-trained models

pre-trained models can be downloaded from here. Due to computational resource constraints, not all images from UTKfaces are used for training. Thus model performance are expected to be improved if more data are used.

worth mentioning that these models are not optimized and built for quick prototyping. There are more areas of improvements

requirements

mtcnn
keras
tensorflow
openCV

face-prediction's People

Contributors

ianforme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

face-prediction's Issues

AttributeError

Hi,

thanks for your work.

i get AttributeError: 'Model' object has no attribute '_distribution_strategy'

i figure it has to do with keras and tf, but i'm unable to find a way.

Best,

xxtu


AttributeError Traceback (most recent call last)

in
20
21 # Find all the faces in the current frame of video
---> 22 face_locations = detect_face(rgb_frame)
23
24 # Display the results

in detect_face(img)
28
29 # create predictions
---> 30 sex_preds = sex_model.predict(center_img.reshape(1,224,224,3))[0][0]
31 age_preds = age_model.predict(center_img.reshape(1,224,224,3))[0][0]
32

~/.pyenv/versions/3.8.7/lib/python3.8/site-packages/tensorflow/python/keras/engine/training.py in predict(self, x, batch_size, verbose, steps, callbacks, max_queue_size, workers, use_multiprocessing)
1580
1581 outputs = None
-> 1582 with self.distribute_strategy.scope():
1583 # Creates a tf.data.Dataset and handles batch and epoch iteration.
1584 dataset_types = (dataset_ops.DatasetV1, dataset_ops.DatasetV2)

~/.pyenv/versions/3.8.7/lib/python3.8/site-packages/tensorflow/python/keras/engine/training.py in distribute_strategy(self)
687 def distribute_strategy(self):
688 """The tf.distribute.Strategy this model was created under."""
--> 689 return self._distribution_strategy or ds_context.get_strategy()
690
691 @Property

AttributeError: 'Model' object has no attribute '_distribution_strategy'

Help with keras.engine

Hi all,

I am trying to run the stream_prediction-upload.py file and I have been facing this error -
keras_engine

I tried some solutions I found specifically change of import styles, but the error persists. Has anyone faced and managed to solve the error?
Thank you very much in advance!

Model' object has no attribute '_call_spec

Model' object has no attribute '_call_spec'
File "C:\Users\mayur_iyd6xcu\OneDrive\Desktop\Python\models\facepred.py", line 41, in detect_face
sex_preds = sex_model.predict(center_img.reshape(1,224,224,3))[0][0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\mayur_iyd6xcu\OneDrive\Desktop\Python\models\facepred.py", line 73, in
face_locations = detect_face(rgb_frame)
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Model' object has no attribute '_call_spec'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.