From 343f9500c2cca0f2ea2907dd21a4614e9201ff94 Mon Sep 17 00:00:00 2001 From: Paul Molodowitch Date: Thu, 12 Sep 2019 15:45:51 -0700 Subject: [PATCH] when using unscaled images, don't make image larger than original ...otherwise, if there are "bad landmarks", images could be VERY large --- mainscripts/Extractor.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mainscripts/Extractor.py b/mainscripts/Extractor.py index b4928b6..eb33451 100644 --- a/mainscripts/Extractor.py +++ b/mainscripts/Extractor.py @@ -229,6 +229,10 @@ class ExtractSubprocessor(Subprocessor): face_image_size = self.image_size if face_image_size == 0 and self.face_type != FaceType.MARK_ONLY: face_image_size = LandmarksProcessor.calc_image_size_for_unscaled(image_landmarks, self.face_type) + # if landmarks are bad, could get HUGE scale... + # ...so set a max size, same as input image biggest + # dimension + face_image_size = min(face_image_size, max(w,h)) if self.face_type == FaceType.MARK_ONLY: image_to_face_mat = None