Skip to content

Commit

Permalink
Relative margin based on face size
Browse files Browse the repository at this point in the history
  • Loading branch information
derneuere committed Sep 9, 2023
1 parent 3c74f9a commit f23b4f1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions api/models/photo.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def _extract_faces(self, second_try=False):
#if applied_to_dimensions:
# image_width = applied_to_dimensions.get("W")
# image_height = applied_to_dimensions.get("H")

# To-Do: Rotation, this is already handled by thumbnail creation?!
#if region.get("Rotation"):
# rotation = region.get("Rotation")
Expand Down Expand Up @@ -680,8 +680,6 @@ def _extract_faces(self, second_try=False):
)
continue



correct_w = float(area["W"])
correct_h = float(area["H"])

Expand Down Expand Up @@ -762,7 +760,7 @@ def _extract_faces(self, second_try=False):

image_path = self.image_hash + "_" + str(idx_face) + ".jpg"

margin = 2
margin = int((right - left) * 0.05)
existing_faces = api.models.face.Face.objects.filter(
photo=self,
location_top__lte=face_location[0] + margin,
Expand Down

0 comments on commit f23b4f1

Please sign in to comment.