serengil / retinaface

RetinaFace: Deep Face Detection Library for Python
https://www.youtube.com/watch?v=Wm1DucuQk70&list=PLsS_1RYmYQQFdWqxQggXHynP1rqaYXv_E&index=3
MIT License
1.23k stars 154 forks source link

Wrong alignment direction issue when "align" set to True with DeepFace detectface using Retinaface detector #12

Closed yvs997 closed 2 years ago

yvs997 commented 3 years ago

Dear Serengil, We're encounter an issue according to align parameters in DeepFace detectface function, and we're using RetinaFace to achive the accuracy.

Here how we call the detectface function from DeepFace:

def face_detect(image):
    face = DeepFace.detectFace(img_path=image, detector_backend='retinaface', align=True)
    return face

and call it by this codes:

def detection(path):
    print (deepface.DeepFace)
    image = Image.open(path)
    image.show()
    face = DeepFace.detectFace(img_path=np.array(image),detector_backend='retinaface',align=True)
    imface = Image.fromarray((face * 255).astype(np.uint8))
    imface.show()

we do small experiment with rotated potrait (90 degree both clockwise and counter clockwise). We expect when align set to true, the face will be aligned. When we test both clockwise and counter clockwise, the output just rotating to other side (180 degree). here is the sample image we get from Google search randomly and we rotate it in PS: 1st: counter90 2nd clockwise90

serengil commented 2 years ago

it seems that the model accuracy is poor for 90 degree rotated images. nothing to do to improve the accuracy because this is a re-implementation.

yvs997 commented 2 years ago

so for this case, is there any future development to fix this thing?