Skip to content
Permalink
Browse files

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
```
  • Loading branch information...
cclauss authored and iperov committed Jun 27, 2019
1 parent 8484060 commit 93ee88959766a913a047a7a9f0be66a01eec40f9
Showing with 1 addition and 1 deletion.
  1. +1 −1 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)

0 comments on commit 93ee889

Please sign in to comment.
You can’t perform that action at this time.