mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 13:02:15 -07:00
fix SampleProcessor
This commit is contained in:
parent
6aa585fa33
commit
5d5718704d
1 changed files with 6 additions and 2 deletions
|
@ -194,9 +194,13 @@ class SampleProcessor(object):
|
||||||
if gaussian_blur is not None:
|
if gaussian_blur is not None:
|
||||||
chance, kernel_max_size = gaussian_blur
|
chance, kernel_max_size = gaussian_blur
|
||||||
chance = np.clip(chance, 0, 100)
|
chance = np.clip(chance, 0, 100)
|
||||||
|
|
||||||
|
rnd_state = np.random.RandomState (sample_rnd_seed+1)
|
||||||
|
gblur_rnd_chance = rnd_state.randint(100)
|
||||||
|
gblur_rnd_kernel = rnd_state.randint(kernel_max_size)*2+1
|
||||||
|
|
||||||
if np.random.randint(100) < chance:
|
if gblur_rnd_chance < chance:
|
||||||
img = cv2.GaussianBlur(img, ( np.random.randint( kernel_max_size )*2+1 ,) *2 , 0)
|
img = cv2.GaussianBlur(img, (gblur_rnd_kernel,) *2 , 0)
|
||||||
|
|
||||||
if is_face_sample:
|
if is_face_sample:
|
||||||
target_ft = SampleProcessor.SPTF_FACETYPE_TO_FACETYPE[target_face_type]
|
target_ft = SampleProcessor.SPTF_FACETYPE_TO_FACETYPE[target_face_type]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue