From 00595a7c58797910460f7324fd1e6158d0a22e84 Mon Sep 17 00:00:00 2001 From: ease_zh Date: Fri, 1 Nov 2024 10:01:53 +0800 Subject: [PATCH 1/2] Update face_analysis.py I believe that the `metric` is an important param that people want to control. --- python-package/insightface/app/face_analysis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-package/insightface/app/face_analysis.py b/python-package/insightface/app/face_analysis.py index 6c3dfcbd2..ade49f9d8 100644 --- a/python-package/insightface/app/face_analysis.py +++ b/python-package/insightface/app/face_analysis.py @@ -55,10 +55,10 @@ def prepare(self, ctx_id, det_thresh=0.5, det_size=(640, 640)): else: model.prepare(ctx_id) - def get(self, img, max_num=0): + def get(self, img, max_num=0, metric='default'): bboxes, kpss = self.det_model.detect(img, max_num=max_num, - metric='default') + metric=metric) if bboxes.shape[0] == 0: return [] ret = [] From a333044b41fef0449c139d1be16159a6002a65f3 Mon Sep 17 00:00:00 2001 From: ease_zh Date: Fri, 1 Nov 2024 11:28:46 +0800 Subject: [PATCH 2/2] Update face_analysis.py rename param name. --- python-package/insightface/app/face_analysis.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-package/insightface/app/face_analysis.py b/python-package/insightface/app/face_analysis.py index ade49f9d8..a9112b14a 100644 --- a/python-package/insightface/app/face_analysis.py +++ b/python-package/insightface/app/face_analysis.py @@ -55,10 +55,10 @@ def prepare(self, ctx_id, det_thresh=0.5, det_size=(640, 640)): else: model.prepare(ctx_id) - def get(self, img, max_num=0, metric='default'): + def get(self, img, max_num=0, det_metric='default'): bboxes, kpss = self.det_model.detect(img, max_num=max_num, - metric=metric) + metric=det_metric) if bboxes.shape[0] == 0: return [] ret = []