dict keys instead of items

This commit is contained in:
Sefik Ilkin Serengil 2023-01-30 21:22:36 +00:00
parent d50ece9db0
commit 95e157e1d9
2 changed files with 5 additions and 3 deletions

View File

@ -435,7 +435,9 @@ disable=raw-checker-failed,
global-statement,
no-member,
no-name-in-module,
unrecognized-option
unrecognized-option,
consider-using-dict-items,
consider-iterating-dictionary
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option

View File

@ -19,8 +19,8 @@ def detect_face(face_detector, img, align=True):
obj = RetinaFace.detect_faces(img, model=face_detector, threshold=0.9)
if isinstance(obj, dict):
for item in obj.items():
identity = item[1]
for face_idx in obj.keys():
identity = obj[face_idx]
facial_area = identity["facial_area"]
y = facial_area[1]