mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-14 00:53:48 -07:00
.
This commit is contained in:
parent
9a540e644c
commit
5a40f537cc
2 changed files with 4 additions and 5 deletions
|
@ -7,9 +7,9 @@ def gen_warp_params (w, flip, rotation_range=[-10,10], scale_range=[-0.5, 0.5],
|
||||||
rnd_state = np.random
|
rnd_state = np.random
|
||||||
|
|
||||||
rw = None
|
rw = None
|
||||||
if w < 16:
|
if w < 64:
|
||||||
rw = w
|
rw = w
|
||||||
w = 16
|
w = 64
|
||||||
|
|
||||||
rotation = rnd_state.uniform( rotation_range[0], rotation_range[1] )
|
rotation = rnd_state.uniform( rotation_range[0], rotation_range[1] )
|
||||||
scale = rnd_state.uniform(1 +scale_range[0], 1 +scale_range[1])
|
scale = rnd_state.uniform(1 +scale_range[0], 1 +scale_range[1])
|
||||||
|
@ -51,7 +51,7 @@ def warp_by_params (params, img, can_warp, can_transform, can_flip, border_repli
|
||||||
rw = params['rw']
|
rw = params['rw']
|
||||||
|
|
||||||
if (can_warp or can_transform) and rw is not None:
|
if (can_warp or can_transform) and rw is not None:
|
||||||
img = cv2.resize(img, (16,16), interpolation=cv2_inter)
|
img = cv2.resize(img, (64,64), interpolation=cv2_inter)
|
||||||
|
|
||||||
if can_warp:
|
if can_warp:
|
||||||
img = cv2.remap(img, params['mapx'], params['mapy'], cv2_inter )
|
img = cv2.remap(img, params['mapx'], params['mapy'], cv2_inter )
|
||||||
|
|
|
@ -141,7 +141,7 @@ def resize2d_nearest(x, size=2):
|
||||||
if size in [-1,0,1]:
|
if size in [-1,0,1]:
|
||||||
return x
|
return x
|
||||||
|
|
||||||
"""
|
|
||||||
if size > 0:
|
if size > 0:
|
||||||
raise Exception("")
|
raise Exception("")
|
||||||
else:
|
else:
|
||||||
|
@ -150,7 +150,6 @@ def resize2d_nearest(x, size=2):
|
||||||
else:
|
else:
|
||||||
x = x[:,::-size,::-size,:]
|
x = x[:,::-size,::-size,:]
|
||||||
return x
|
return x
|
||||||
"""
|
|
||||||
|
|
||||||
h = x.shape[nn.conv2d_spatial_axes[0]].value
|
h = x.shape[nn.conv2d_spatial_axes[0]].value
|
||||||
w = x.shape[nn.conv2d_spatial_axes[1]].value
|
w = x.shape[nn.conv2d_spatial_axes[1]].value
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue