fix cv2.resize interpolation

This commit is contained in:
Colombo 2020-07-03 18:40:35 +04:00
commit 770da74a9b
6 changed files with 25 additions and 25 deletions

View file

@ -79,8 +79,8 @@ def apply_random_bilinear_resize( img, chance, max_size_per, mask=None, rnd_stat
rw = w - int( trg * int(w*(max_size_per/100.0)) )
rh = h - int( trg * int(h*(max_size_per/100.0)) )
result = cv2.resize (result, (rw,rh), cv2.INTER_LINEAR )
result = cv2.resize (result, (w,h), cv2.INTER_LINEAR )
result = cv2.resize (result, (rw,rh), interpolation=cv2.INTER_LINEAR )
result = cv2.resize (result, (w,h), interpolation=cv2.INTER_LINEAR )
if mask is not None:
result = img*(1-mask) + result*mask

View file

@ -51,7 +51,7 @@ def warp_by_params (params, img, can_warp, can_transform, can_flip, border_repli
rw = params['rw']
if (can_warp or can_transform) and rw is not None:
img = cv2.resize(img, (16,16), cv2_inter)
img = cv2.resize(img, (16,16), interpolation=cv2_inter)
if can_warp:
img = cv2.remap(img, params['mapx'], params['mapy'], cv2_inter )
@ -60,7 +60,7 @@ def warp_by_params (params, img, can_warp, can_transform, can_flip, border_repli
if (can_warp or can_transform) and rw is not None:
img = cv2.resize(img, (rw,rw), cv2_inter)
img = cv2.resize(img, (rw,rw), interpolation=cv2_inter)
if len(img.shape) == 2:
img = img[...,None]