mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-08-22 22:34:25 -07:00
Merge pull request #61 from elrond79/fix/unscaled_max_image_size
when using unscaled images, don't make image larger than original
This commit is contained in:
commit
1ad626cdf5
1 changed files with 4 additions and 0 deletions
|
@ -229,6 +229,10 @@ class ExtractSubprocessor(Subprocessor):
|
||||||
face_image_size = self.image_size
|
face_image_size = self.image_size
|
||||||
if face_image_size == 0 and self.face_type != FaceType.MARK_ONLY:
|
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)
|
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:
|
if self.face_type == FaceType.MARK_ONLY:
|
||||||
image_to_face_mat = None
|
image_to_face_mat = None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue