import random
from megengine.data.transform import RandomResizedCrop as mge_RRC
from megengine.data.transform import Resize as mge_resize
from ..registry import PIPELINES
from edit.utils import interp_codes

@PIPELINES.register_module()
class Resize(object):
    """
        Args:
        size (int|list|tuple): Desired output size. If size is a sequence like
            (h, w), output size will be matched to this. If size is an int,
            smaller edge of the image will be matched to this number.
            i.e, if height > width, then image will be rescaled to
            (size * height / width, size)
        interpolation (int): Interpolation mode of resize. Default: cv2.INTER_LINEAR.
    """
    def __init__(self, keys, size, interpolation='bilinear'):
        assert interpolation in interp_codes
        self.keys = keys
        self.size = size
        self.interpolation_str = interpolation
        self.resize = 
mge_resize(output_size=self.size, interpolation=interp_codes[interpolation])