From 95e157e1d99aa6205eb2c870b6800901cb44c7e0 Mon Sep 17 00:00:00 2001 From: Sefik Ilkin Serengil Date: Mon, 30 Jan 2023 21:22:36 +0000 Subject: [PATCH] dict keys instead of items --- .pylintrc | 4 +++- deepface/detectors/RetinaFaceWrapper.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.pylintrc b/.pylintrc index 9648bef..5f08b83 100644 --- a/.pylintrc +++ b/.pylintrc @@ -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 diff --git a/deepface/detectors/RetinaFaceWrapper.py b/deepface/detectors/RetinaFaceWrapper.py index 93ed3e1..514d962 100644 --- a/deepface/detectors/RetinaFaceWrapper.py +++ b/deepface/detectors/RetinaFaceWrapper.py @@ -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]