biubug6 / Pytorch_Retinaface

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

Square face bounding box #73

Open miracleyoo opened 4 years ago

miracleyoo commented 4 years ago

Hello,

This is a really impressive repo! I want to deploy this project as a face extraction module for my research, and I tried out using the checkpoints you put in README.

However, I wonder whether there is any method to change the output face bounding box to squares like what dlib or other face detectors are doing, since I need to use the result of the bounding box as the input to 68-points landmark prediction and the target method is trained on the square bounding box.

flywheel1412 commented 4 years ago

you could get square bounding box by fellow method

cx, cy = left_x + width*1.0 / 2, left_y + height*1.0 / 2 
size = max(width, height)
left_x = cx - size / 2 
left_y = cy - size/2 
width = size
height = size