refactoring

This commit is contained in:
Colombo 2020-03-06 01:21:38 +04:00
commit 54548afe1a
6 changed files with 110 additions and 25 deletions

View file

@ -2,11 +2,7 @@ import numpy as np
import cv2
from core import randomex
def gen_warp_params (source, flip, rotation_range=[-10,10], scale_range=[-0.5, 0.5], tx_range=[-0.05, 0.05], ty_range=[-0.05, 0.05], rnd_state=None ):
h,w,c = source.shape
if (h != w):
raise ValueError ('gen_warp_params accepts only square images.')
def gen_warp_params (w, flip, rotation_range=[-10,10], scale_range=[-0.5, 0.5], tx_range=[-0.05, 0.05], ty_range=[-0.05, 0.05], rnd_state=None ):
if rnd_state is None:
rnd_state = np.random