(self, imgs)
return x, scales
Preprocess images.

        Args:
            imgs (iterable of numpy.ndarray): Arrays holding images.
                All images are in CHW and RGB format
                and the range of their value is :math:`[0, 255]`.

        Returns:
            Two arrays: preprocessed images and \
            scales that were caluclated in prepocessing.
Preprocess images.
Preprocess images .
def prepare(self, imgs):
        """Preprocess images.

        Args:
            imgs (iterable of numpy.ndarray): Arrays holding images.
                All images are in CHW and RGB format
                and the range of their value is :math:`[0, 255]`.

        Returns:
            Two arrays: preprocessed images and \
            scales that were caluclated in prepocessing.

        """
        scales = []
        resized_imgs = []
        for img in imgs:
            img, scale = scale_img(
                img, self._min_size, self._max_size)
            img -= self.extractor.mean
            scales.append(scale)
            resized_imgs.append(img)
        pad_size = np.array(
            [im.shape[1:] for im in resized_imgs]).max(axis=0)
        pad_size = (
            np.ceil(pad_size / self.stride) * self.stride).astype(int)
        x = np.zeros(
            (len(imgs), 3, pad_size[0], pad_size[1]), dtype=np.float32)
        for i, im in enumerate(resized_imgs):
            _, H, W = im.shape
            x[i, :, :H, :W] = im
        x = self.xp.array(x)

        return x, scales
def prepare ( self , imgs ) : scales = [ ] resized_imgs = [ ] for img in imgs : img , scale = scale_img ( img , self . _min_size , self . _max_size ) img -= self . extractor . mean scales . append ( scale ) resized_imgs . append ( img ) pad_size = np . array ( [ im . shape [ 1 : ] for im in resized_imgs ] ) . max ( axis = 0 ) pad_size = ( np . ceil ( pad_size / self . stride ) * self . stride ) . astype ( int ) x = np . zeros ( ( len ( imgs ) , 3 , pad_size [ 0 ] , pad_size [ 1 ] ) , dtype = np . float32 ) for i , im in enumerate ( resized_imgs ) : _ , H , W = im . shape x [ i , : , : H , : W ] = im x = self . xp . array ( x ) return x , scales