mirror of
https://github.com/iperov/DeepFaceLive
synced 2025-07-11 15:47:02 -07:00
change hsv args
This commit is contained in:
parent
fd0ee234b7
commit
b80860cca7
2 changed files with 4 additions and 4 deletions
|
@ -196,7 +196,7 @@ class TrainingDataGenerator(lib_mp.MPWorker):
|
|||
ip = lib_img.ImageProcessor(img_aligned_shifted)
|
||||
rnd = np.random
|
||||
if rnd.randint(2) == 0:
|
||||
ip.hsv( rnd.randint(0, 360), rnd.uniform(-0.5,0.5), rnd.uniform(-0.5,0.5), mask=lib_sd.random_circle_faded_multi((resolution,resolution), complexity=random_mask_complexity))
|
||||
ip.hsv( rnd.uniform(0,1), rnd.uniform(-0.5,0.5), rnd.uniform(-0.5,0.5), mask=lib_sd.random_circle_faded_multi((resolution,resolution), complexity=random_mask_complexity))
|
||||
else:
|
||||
ip.levels( [ [rnd.uniform(0,0.25),rnd.uniform(0.75,1.0),rnd.uniform(0.5,1.5), rnd.uniform(0,0.25),rnd.uniform(0.75,1.0), ],
|
||||
[rnd.uniform(0,0.25),rnd.uniform(0.75,1.0),rnd.uniform(0.5,1.5), rnd.uniform(0,0.25),rnd.uniform(0.75,1.0),],
|
||||
|
|
|
@ -466,9 +466,9 @@ class ImageProcessor:
|
|||
"""
|
||||
apply HSV modification for BGR image
|
||||
|
||||
h_diff = [-360.0 .. 360.0]
|
||||
s_diff = [-1.0 .. 1.0]
|
||||
h_diff = [-1.0 .. 1.0]
|
||||
s_diff = [-1.0 .. 1.0]
|
||||
v_diff = [-1.0 .. 1.0]
|
||||
"""
|
||||
dtype = self.get_dtype()
|
||||
self.to_ufloat32()
|
||||
|
@ -481,7 +481,7 @@ class ImageProcessor:
|
|||
img = img.reshape( (N*H,W,C) )
|
||||
|
||||
h, s, v = cv2.split(cv2.cvtColor(img, cv2.COLOR_BGR2HSV))
|
||||
h = ( h + h_diff ) % 360
|
||||
h = ( h + h_diff*360.0 ) % 360
|
||||
|
||||
s += s_diff
|
||||
np.clip (s, 0, 1, out=s )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue