question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Face Preparation for Model Prediction

See original GitHub issue

Hi,

How can I read/align/prepare face for making predict on trained model? I made code like this:

    model = create_deepface()
    model.load_weights('VGGFace2_DeepFace_weights_val-0.9034.h5')
    img = load_img(path)
    img = img.resize((152,152))
    img_array = img_to_array(img)
    img_array = img_array.reshape((-1, 152, 152, 3))
    res = model.predict(img_array)

I get different results for every face belonging to the same person.

Thanks a lot for a help

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:22 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
FunkyKokicommented, Jul 2, 2020

Thank you so much for your sharing. Indeed, I have 2 questions about the 3D-to-2D process. First, what are the 8 unknows in the affine camera P mean? Location, gesture and lens? Second, the author added the residual r into the 3d coordinates, but this operation can be done only if the coordinates systems are aligned, how could that be done?

I would check the resources you shared and try to re-implement the whole process. By the way, actually, in the modern network, the strong 3D alignment seems not to be a necessity. I am interested in the 3D alignment only because that I am working in the 3D reconstruction of face.

I would let you know when I solve the two questions above.

Thanks again.

1reaction
FunkyKokicommented, Jun 30, 2020

Hello, thanks for your work first. I am reading DeepFace, and I am quite confused about the 3D alignment step. To be specific, I cannot tell what is the affine 3D-to-2D camera P (what are the 8 unknowns mean?). Please help me. Thank you a lot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Face Recognition for Beginners - Towards Data Science
This technique is usually used to derive a feature space from the image division. The sample image compared to the training set. On...
Read more >
How to Perform Face Recognition With VGGFace2 in Keras
This Keras model can be used directly to predict the probability of a given face belonging to one or more of more than...
Read more >
Detect faces and predict BMI, Age and Gender using Keras
In this post, we build a model that provides end-to-end capability of detecting faces from image and predicting the BMI, Age and Gender...
Read more >
Build a Deep Face Detection Model with Python and Tensorflow
Learn how to build a face detection model using an Object Detection architecture using Tensorflow and Python!
Read more >
Deep learning based face beauty prediction via dynamic ...
In this paper, we address Facial Beauty Prediction from static images. The paper contains three main contributions. First, we propose a two- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found