diff --git a/mainscripts/Extractor.py b/mainscripts/Extractor.py index bf4affd..3a653e3 100644 --- a/mainscripts/Extractor.py +++ b/mainscripts/Extractor.py @@ -242,7 +242,7 @@ class ExtractSubprocessor(Subprocessor): rect_area = mathlib.polygon_area(np.array(rect[[0,2,2,0]]), np.array(rect[[1,1,3,3]])) landmarks_area = mathlib.polygon_area(landmarks_bbox[:,0], landmarks_bbox[:,1] ) - if landmarks_area > 4*rect_area: #get rid of faces which umeyama-landmark-area > 4*detector-rect-area + if self.face_type <= FaceType.FULL_NO_ALIGN and landmarks_area > 4*rect_area: #get rid of faces which umeyama-landmark-area > 4*detector-rect-area continue if self.debug_dir is not None: diff --git a/samplelib/SampleProcessor.py b/samplelib/SampleProcessor.py index 609a39c..3ba0f80 100644 --- a/samplelib/SampleProcessor.py +++ b/samplelib/SampleProcessor.py @@ -291,7 +291,7 @@ class SampleProcessor(object): rnd_state = np.random.RandomState (sample_rnd_seed) img = np.take (img_bgr, rnd_state.permutation(img_bgr.shape[-1]), axis=-1) elif mode_type == SPTF.MODE_G: - img = np.concatenate ( (np.expand_dims(cv2.cvtColor(img_bgr, cv2.COLOR_BGR2GRAY),-1),img_mask) , -1 ) + img = cv2.cvtColor(img_bgr, cv2.COLOR_BGR2GRAY)[...,None] elif mode_type == SPTF.MODE_GGG: img = np.repeat ( np.expand_dims(cv2.cvtColor(img_bgr, cv2.COLOR_BGR2GRAY),-1), (3,), -1) elif mode_type == SPTF.MODE_M and is_face_sample: