fix extractor

This commit is contained in:
Colombo 2020-07-03 16:06:06 +04:00
parent 4ce4997d1a
commit 57ea3e61b7

View file

@ -151,7 +151,9 @@ class ExtractSubprocessor(Subprocessor):
if len(rects) != 0:
data.rects_rotation = rot
break
if max_faces_from_image is not None and len(data.rects) > 1:
if max_faces_from_image is not None and \
max_faces_from_image > 0 and \
len(data.rects) > 0:
data.rects = data.rects[0:max_faces_from_image]
return data