deepinsight / insightface

State-of-the-art 2D and 3D Face Analysis Project
https://insightface.ai
23.39k stars 5.41k forks source link

RetinaFace Confidence score and eleminate poor faces. #1075

Open MyraBaba opened 4 years ago

MyraBaba commented 4 years ago

Hi,

First of all thanks for such power full face detection algorithm.

How can I a get a score for detected face confidence ?

And is there any way to get whether landmark visible or not ?

I attached few test images and I don't want them detected.

Any idea ? Best

Screenshot from 2020-03-09 18-14-24 Screenshot from 2020-03-09 18-13-37 Screenshot from 2020-03-09 18-13-28

jmorrill commented 4 years ago

As far as I could tell, you aren't going to get a good metric from retinaface on quality, only confidence.

You can pull the 512 face features from the recognition model, then l2 norm the result to get something of a quality. Lower numbers (~10?) will be worse quality, higher numbers will be better quality (~28?)

MyraBaba commented 4 years ago

do you mean the insightface mxnet features result (512) ?

and numpy.linalg.norm(feature512) . is the way ?

jmorrill commented 4 years ago

do you mean the insightface mxnet features result (512) ?

and numpy.linalg.norm(feature512) . is the way ?

Yeah the feature results from arcface.

I don't know numpy or python well, but in C++ l2 norm is this:

    float l2_norm(const std::vector<float>& f)
    {
        float m_sum = 0.0;
        for (floati : f)
        {
            m_sum += i * i;
        }
        return std::sqrt(m_sum);
    }
MyraBaba commented 4 years ago

Thx

On 18 Mar 2020, at 21:00, jmorrill notifications@github.com wrote:

do you mean the insightface mxnet features result (512) ?

and numpy.linalg.norm(feature512) . is the way ?

Yeah the feature results from arcface.

I don't know numpy or python well, but in C++ l2 norm is this:

float l2_norm(const std::vector<float>& f)
{
    float m_sum = 0.0;
    for (floati : f)
    {
        m_sum += i * i;
    }
    return std::sqrt(m_sum);
}

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/deepinsight/insightface/issues/1075#issuecomment-600778941, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEFRZH67BAC3B77CZRIP5ADRIED3LANCNFSM4LELPP5A.

pasa13142 commented 4 years ago

hi @MyraBaba its out of topic but How did you extract aligned face from image ?

MyraBaba commented 4 years ago

@jmorrill Hi,

I tested 128 mobile model feature with the both eigen sqrtnorm(l2) and the above given your code

and the std::sqrt(m_sum) is always 1 or 0.99xx ?

liutianyuan commented 4 years ago

Hi,

First of all thanks for such power full face detection algorithm.

How can I a get a score for detected face confidence ?

And is there any way to get whether landmark visible or not ?

I attached few test images and I don't want them detected.

Any idea ? Best

@MyraBaba I have the same issue, have you got solved? Thank you.

MyraBaba commented 4 years ago

@yingfeng not solved yet..

jmorrill commented 4 years ago

@jmorrill Hi,

I tested 128 mobile model feature with the both eigen sqrtnorm(l2) and the above given your code

and the std::sqrt(m_sum) is always 1 or 0.99xx ?

I do this on the 512 features. I do from C++ too, so i dont know if you are doing this with the raw output of the network, or if the features have already been normalized. (I do it with the values right from the network)

I got the idea from page 4 of this document (top right). https://arxiv.org/pdf/1804.01159.pdf

MyraBaba commented 4 years ago

What I saw in my code its normalized . So I need to do this before normalization right ?

Best

On 1 Apr 2020, at 10:11, jmorrill notifications@github.com wrote:

@jmorrill https://github.com/jmorrill Hi,

I tested 128 mobile model feature with the both eigen sqrtnorm(l2) and the above given your code

and the std::sqrt(m_sum) is always 1 or 0.99xx ?

I do this on the 512 features. I do from C++ too, so i dont know if you are doing this with the raw output of the network, or if the features have already been normalized. (I do it with the values right from the network)

I got the idea from page 4 of this document (top right). https://arxiv.org/pdf/1804.01159.pdf https://arxiv.org/pdf/1804.01159.pdf — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/deepinsight/insightface/issues/1075#issuecomment-607075812, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEFRZHZCWIFGJXUFS7AGG6LRKLSKFANCNFSM4LELPP5A.

KanchanIIT commented 4 years ago

does anyone solve this issue? thanks!

avn3r commented 3 years ago

yeah having keypoints scores (visibility) and detection scores are of great value.

cesarandreslopez commented 3 years ago

This would be of great value, agreed.

MyraBaba commented 3 years ago

@avn3r

Would you mind to give a small example or direction for both having keypoints scores (visibility) and detection scores ?

Arslan-Mehmood1 commented 9 months ago

hi @MyraBaba its out of topic but How did you extract aligned face from image ?

deepface.extract_faces returns aligned faces for some detectors like retinaface