Cosmetic changes

This commit is contained in:
henryruhs
2023-10-14 21:07:45 +02:00
parent d80d496b93
commit c83219eb7c
+6 -6
View File
@@ -87,13 +87,13 @@ def sort_by_direction(faces : List[Face], direction : FaceAnalyserDirection) ->
def filter_by_age(faces : List[Face], age : FaceAnalyserAge) -> List[Face]:
filter_faces = []
for face in faces:
if face['age'] < 13 and age == 'child':
if face.age < 13 and age == 'child':
filter_faces.append(face)
elif face['age'] < 19 and age == 'teen':
elif face.age < 19 and age == 'teen':
filter_faces.append(face)
elif face['age'] < 60 and age == 'adult':
elif face.age < 60 and age == 'adult':
filter_faces.append(face)
elif face['age'] > 59 and age == 'senior':
elif face.age > 59 and age == 'senior':
filter_faces.append(face)
return filter_faces
@@ -101,8 +101,8 @@ def filter_by_age(faces : List[Face], age : FaceAnalyserAge) -> List[Face]:
def filter_by_gender(faces : List[Face], gender : FaceAnalyserGender) -> List[Face]:
filter_faces = []
for face in faces:
if face['gender'] == 1 and gender == 'male':
if face.gender == 1 and gender == 'male':
filter_faces.append(face)
if face['gender'] == 0 and gender == 'female':
if face.gender == 0 and gender == 'female':
filter_faces.append(face)
return filter_faces