Fixed bug with ssd facebox region

This commit is contained in:
Sean Yong 2021-02-17 13:55:49 +08:00
parent e22072142e
commit 1f8bea146e
2 changed files with 3 additions and 2 deletions

3
.gitignore vendored
View File

@ -14,4 +14,5 @@ deepface/commons/__pycache__/*
deepface/basemodels/__pycache__/*
deepface/extendedmodels/__pycache__/*
deepface/subsidiarymodels/__pycache__/*
tests/dataset/*.pkl
tests/dataset/*.pkl
Age_Gender_Retail_Analysis.ipynb

View File

@ -260,7 +260,7 @@ def detect_face(img, detector_backend = 'opencv', grayscale = False, enforce_det
detected_face = base_img[int(top*aspect_ratio_y):int(bottom*aspect_ratio_y), int(left*aspect_ratio_x):int(right*aspect_ratio_x)]
return detected_face, [int(left*aspect_ratio_x), int(top*aspect_ratio_y), int(right*aspect_ratio_y) - int(left*aspect_ratio_x), int(bottom*aspect_ratio_y) - int(top*aspect_ratio_y)]
return detected_face, [int(left*aspect_ratio_x), int(top*aspect_ratio_y), int(right*aspect_ratio_x) - int(left*aspect_ratio_x), int(bottom*aspect_ratio_y) - int(top*aspect_ratio_y)]
else: #if no face detected