insightface icon indicating copy to clipboard operation
insightface copied to clipboard

RetinaFace Confidence score and eleminate poor faces.

Open MyraBaba opened this issue 5 years ago • 15 comments

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

MyraBaba avatar Mar 09 '20 15:03 MyraBaba

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?)

jmorrill avatar Mar 17 '20 23:03 jmorrill

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

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

MyraBaba avatar Mar 18 '20 17:03 MyraBaba

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);
    }

jmorrill avatar Mar 18 '20 18:03 jmorrill

Thx

On 18 Mar 2020, at 21:00, jmorrill [email protected] 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.

MyraBaba avatar Mar 18 '20 18:03 MyraBaba

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

pasa13142 avatar Mar 26 '20 08:03 pasa13142

@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 ?

MyraBaba avatar Mar 28 '20 00:03 MyraBaba

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.

liutianyuan avatar Mar 29 '20 14:03 liutianyuan

@yingfeng not solved yet..

MyraBaba avatar Mar 29 '20 15:03 MyraBaba

@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

jmorrill avatar Apr 01 '20 07:04 jmorrill

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 [email protected] 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.

MyraBaba avatar Apr 01 '20 12:04 MyraBaba

does anyone solve this issue? thanks!

KanchanIIT avatar Sep 02 '20 12:09 KanchanIIT

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

avn3r avatar Apr 26 '21 00:04 avn3r

This would be of great value, agreed.

cesarandreslopez avatar May 19 '21 18:05 cesarandreslopez

@avn3r

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

MyraBaba avatar Nov 09 '21 13:11 MyraBaba

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

Arslan-Mehmood1 avatar Feb 10 '24 10:02 Arslan-Mehmood1