From 93ee88959766a913a047a7a9f0be66a01eec40f9 Mon Sep 17 00:00:00 2001 From: cclauss Date: Thu, 27 Jun 2019 19:10:22 +0200 Subject: [PATCH] Identity is not the same thing as equality in Python (#291) Use ==/!= to compare str, bytes, and int literals $ python ```python >>> method = 'Mi' >>> method += 'n' >>> method == 'Min' True >>> method is 'Min' False ``` --- facelib/MTCExtractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/facelib/MTCExtractor.py b/facelib/MTCExtractor.py index 4381af0..c524ab9 100644 --- a/facelib/MTCExtractor.py +++ b/facelib/MTCExtractor.py @@ -291,7 +291,7 @@ def nms(boxes, threshold, method): w = np.maximum(0.0, xx2-xx1+1) h = np.maximum(0.0, yy2-yy1+1) inter = w * h - if method is 'Min': + if method == 'Min': o = inter / np.minimum(area[i], area[idx]) else: o = inter / (area[i] + area[idx] - inter)