提交 fdc40d1e 编写于 作者: S shippingwang

fix

上级 bb622b24
......@@ -46,7 +46,7 @@ TRAIN:
channel_first: False
- RandCropImage:
size: 224
#interpolation: 2
interpolation: 2
- RandFlipImage:
flip_code: 1
- AutoAugment:
......
......@@ -117,7 +117,9 @@ class CropImage(object):
class RandCropImage(object):
""" random crop image """
def __init__(self, size, scale=None, ratio=None):
def __init__(self, size, scale=None, ratio=None, interpolation=-1):
self.interpolation = interpolation if interpolation >= 0 else None
if type(size) is int:
self.size = (size, size) # (h, w)
else:
......@@ -151,7 +153,10 @@ class RandCropImage(object):
j = random.randint(0, img_h - h)
img = img[j:j + h, i:i + w, :]
return cv2.resize(img, size)
if self.interpolation is None:
return cv2.resize(img, size)
else:
return cv2.resize(img, size, interpolation=self.interpolation)
class RandFlipImage(object):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册