For a LabelList `ll_input`, resize each image to `size` using `resize_method` and `padding_mode`.
515902
def padded_ds(ll_input, size=(250, 300), resize_method=ResizeMethod.CROP, padding_mode='zeros', **kwargs):
        ""
        return ll_input.transform(tfms=crop_pad(), size=size, resize_method=resize_method, padding_mode=padding_mode)
800486
def crop_or_pad_to(height, width):
    
    def inner(t_image):
        return tf.image.resize_image_with_crop_or_pad(t_image, height, width)
    return inner
876242
def _get_resize_options(self, dimensions):
        
        if dimensions and isinstance(dimensions, (tuple, list)):
            if len(dimensions) < 3:
                dimensions = tuple(dimensions) + (False, )
            return dimensions
735575
def resize(self, size, *args, **kwargs):
        

        ratios = tuple(float(s) / float(s_orig) for s, s_orig in zip(size, self.size))
        if ratios[0] == ratios[1]:
            ratio = ratios[0]
            scaled_box = self.bbox * ratio
            bbox = BoxList(scaled_box, size, mode=self.mode)
            # bbox._copy_extra_fields(self)
            for k, v in self.extra_fields.items():
                if not isinstance(v, torch.Tensor):
                    v = v.resize(size, *args, **kwargs)
                bbox.add_field(k, v)
            return bbox

        ratio_width, ratio_height = ratios
        xmin, ymin, xmax, ymax = self._split_into_xyxy()
        scaled_xmin = xmin * ratio_width
        scaled_xmax = xmax * ratio_width
        scaled_ymin = ymin * ratio_height
        scaled_ymax = ymax * ratio_height
        scaled_box = torch.cat(
            (scaled_xmin, scaled_ymin, scaled_xmax, scaled_ymax), dim=-1
        )
        bbox = BoxList(scaled_box, size, mode="xyxy")
        # bbox._copy_extra_fields(self)
        for k, v in self.extra_fields.items():
            if not isinstance(v, torch.Tensor):
                v = v.resize(size, *args, **kwargs)
            bbox.add_field(k, v)

        return bbox.convert(self.mode)
875286
def resizeEvent(self, event):
        

        frame_width = self.style().pixelMetric(QStyle.PM_DefaultFrameWidth)
        search_active_labelSize = self.__search_active_label.sizeHint()
        self.__search_active_label.move(self.rect().left() + frame_width,
                                        (self.rect().bottom() - search_active_labelSize.height()) / 2 + frame_width / 2)
        clear_buttonSize = self.__clear_button.sizeHint()
        self.__clear_button.move(self.rect().right() - frame_width - clear_buttonSize.width(),
                                 (self.rect().bottom() - clear_buttonSize.height()) / 2 + frame_width / 2)
1135754
def _convert_image(self, im):
        
        pixels   = []
        pix_line = ""
        im_left  = ""
        im_right = ""
        switch   = 0
        img_size = [ 0, 0 ]


        if im.size[0] > 512:
            print  "WARNING: Image is wider than 512 and could be truncated at print time "
        if im.size[1] > 255:
            raise ImageSizeError()

        im_border = self._check_image_size(im.size[0])
        for i in range(im_border[0]):
            im_left += "0"
        for i in range(im_border[1]):
            im_right += "0"

        for y in range(im.size[1]):
            img_size[1] += 1
            pix_line += im_left
            img_size[0] += im_border[0]
            for x in range(im.size[0]):
                img_size[0] += 1
                RGB = im.getpixel((x, y))
                im_color = (RGB[0] + RGB[1] + RGB[2])
                im_pattern = "1X0"
                pattern_len = len(im_pattern)
                switch = (switch - 1 ) * (-1)
                for x in range(pattern_len):
                    if im_color <= (255 * 3 / pattern_len * (x+1)):
                        if im_pattern[x] == "X":
                            pix_line += "%d" % switch
                        else:
                            pix_line += im_pattern[x]
                        break
                    elif im_color > (255 * 3 / pattern_len * pattern_len) and im_color <= (255 * 3):
                        pix_line += im_pattern[-1]
                        break 
            pix_line += im_right
            img_size[0] += im_border[1]

        return (pix_line, img_size)
1099430
def resized(*args, **kwargs):
    
    resized_image = None
    try:
        resized_image = resize(*args, **kwargs)
        yield resized_image
    finally:
        if resized_image is not None:
            resized_image.close()
771044
def crop_to_fit(self, image_size, view_size):
        
        self.blipFill.crop(self._fill_cropping(image_size, view_size))
1274823
def resize(self, size):
        
        self.instance.resize_volume(size)
        self.size = size
537384
def preprocess_example(self, example, mode, hparams):
    """"""
    if getattr(hparams, "preprocess_resize_frames", None) is not None:
      example["frame"] = tf.image.resize_images(
          example["frame"], hparams.preprocess_resize_frames,
          tf.image.ResizeMethod.BILINEAR)
    return example
476697
def resize(self, size):
        
        if isinstance(self._data, Stream):
            self._data.resize(size)
571569
def htmlize_list(items):
    
    out = ["<ul>"]
    for item in items:
        out.append("<li>" + htmlize(item) + "</li>")
    out.append("</ul>")
    return "\n".join(out)
356969
def resize(self, size:Union[int,TensorImageSize])->'Image':
        ""
        assert self._flow is None
        if isinstance(size, int): size=(self.shape[0], size, size)
        if tuple(size)==tuple(self.shape): return self
        self.flow = _affine_grid(size)
        return self
943036
def _add_fixed_dim(self, fixed_dim=-1):
        """"""

        if fixed_dim in [-1, None, 'last']:
            fixed_dim = len(self.input_image.shape) - 1  # last dimension

        if int(fixed_dim)!=fixed_dim or \
            fixed_dim > len(self.input_image.shape) or \
            fixed_dim < -1:
            raise ValueError('invalid value for the dimension to be fixed!'
                             'Must be an integer in range [0, {}] inclusive'
                             ''.format(len(self.input_image.shape)))

        if self.input_image.shape[fixed_dim] < 2:
            raise ValueError('Input image must have atleast two samples '
                             'in the fixed dimension. It has {}. '
                             'Full image shape: {} '
                             ''.format(self.input_image.shape[fixed_dim],
                                       self.input_image.shape))

        self.fixed_dim = int(fixed_dim)
24341
public static int resizeImage(BufferedImage inputImage, String dest, int width, int height, float quality)
			throws IOException {
		BufferedImage outputImage = Scalr.resize(inputImage, Scalr.Method.QUALITY, Scalr.Mode.AUTOMATIC, width, height,
				Scalr.OP_ANTIALIAS);
		return writeImage(dest, outputImage, 0.9f);
	}
416258
def resize_image(image_str_tensor):
  """"""

  image = decode_and_resize(image_str_tensor)
  image = tf.image.encode_jpeg(image, quality=100)
  return image
114057
def _resize(self, init=False):
        col, row = self._selection_to_col_row(self.selection)
        if not (self.startPos <= row <= self.startPos + self.list_maxY - 1):
            while row > self.startPos:
                self.startPos += 1
            while row < self.startPos + self.list_maxY - 1:
                self.startPos -= 1
        '''  '''
        if init and row > self.list_maxY:
            new_startPos = self._num_of_rows - self.list_maxY + 1
            if row > new_startPos:
                if logger.isEnabledFor(logging.DEBUG):
                    logger.debug('setting startPos at {}'.format(new_startPos))
                self.startPos = new_startPos
        self.refresh_selection()