biubug6 / Pytorch_Retinaface

Retinaface get 80.99% in widerface hard val using mobilenet0.25.
MIT License
2.63k stars 774 forks source link

two eyes #9

Closed wang-kangkang closed 5 years ago

wang-kangkang commented 5 years ago

when i conduct similar trial in my face detection codebase, the two eyes' lmk points overlap and always between the eyebrows. But the nose lmk is always right. Do you know what might be the reason?

takecareofbigboss commented 5 years ago

i met the same problem, and hope get ur reply. Is it convenient for you to link with me by wechat(my wechat number: bigbossofwhom). image

takecareofbigboss commented 5 years ago

@biubug6

biubug6 commented 5 years ago

In general, in order to detect the key points accurately, it is necessary to have a large learning rate for the key points. Through such methods the network can be optimized in the direction of utilizing the key points detection.

Dian-Yi commented 4 years ago

@wang-kangkang @takecareofbigboss have you solved this problem? i meet the same case. the lmk points overlap and always between the eyebrows.

wang-kangkang commented 4 years ago

which may because you didn't notice in data argument, if do the mirror operation of this image, the left eye will be right eye, and vice versa. You should read the following code carefully.

https://github.com/biubug6/Pytorch_Retinaface/blob/96b72093758eeaad985125237a2d9d34d28cf768/data/data_augment.py#L167

def mirror(image, boxes, landms): , width, _ = image.shape if random.randrange(2): image = image[:, ::-1] boxes = boxes.copy() boxes[:, 0::2] = width - boxes[:, 2::-2]

landm

    landms = landms.copy()
    landms = landms.reshape([-1, 5, 2])
    landms[:, :, 0] = width - landms[:, :, 0]
    tmp = landms[:, 1, :].copy()
    landms[:, 1, :] = landms[:, 0, :]
    landms[:, 0, :] = tmp
    tmp1 = landms[:, 4, :].copy()
    landms[:, 4, :] = landms[:, 3, :]
    landms[:, 3, :] = tmp1
    landms = landms.reshape([-1, 10])

return image, boxes, landms
Dian-Yi commented 4 years ago

which may because you didn't notice in data argument, if do the mirror operation of this image, the left eye will be right eye, and vice versa. You should read the following code carefully.

https://github.com/biubug6/Pytorch_Retinaface/blob/96b72093758eeaad985125237a2d9d34d28cf768/data/data_augment.py#L167

def mirror(image, boxes, landms): , width, _ = image.shape if random.randrange(2): image = image[:, ::-1] boxes = boxes.copy() boxes[:, 0::2] = width - boxes[:, 2::-2]

landm

landms = landms.copy() landms = landms.reshape([-1, 5, 2]) landms[:, :, 0] = width - landms[:, :, 0] tmp = landms[:, 1, :].copy() landms[:, 1, :] = landms[:, 0, :] landms[:, 0, :] = tmp tmp1 = landms[:, 4, :].copy() landms[:, 4, :] = landms[:, 3, :] landms[:, 3, :] = tmp1 landms = landms.reshape([-1, 10])

return image, boxes, landms

thanks very much, i find my code bug in mirror images. the left and right points value is error.