@@ -97,12 +97,12 @@ def make_tiles(imgi, bsize=224, augment=False, tile_overlap=0.1):
9797 tile_overlap (float, optional): Fraction of overlap of tiles. Defaults to 0.1.
9898
9999 Returns:
100- tuple containing
101- - IMG (np.ndarray): Array of shape (ntiles, nchan, bsize, bsize) representing the tiles.
102- - ysub (list): List of arrays with start and end of tiles in Y of length ntiles.
103- - xsub (list): List of arrays with start and end of tiles in X of length ntiles.
104- - Ly (int): Height of the input image.
105- - Lx (int): Width of the input image.
100+ A tuple containing (IMG, ysub, xsub, Ly, Lx):
101+ IMG (np.ndarray): Array of shape (ntiles, nchan, bsize, bsize) representing the tiles.
102+ ysub (list): List of arrays with start and end of tiles in Y of length ntiles.
103+ xsub (list): List of arrays with start and end of tiles in X of length ntiles.
104+ Ly (int): Height of the input image.
105+ Lx (int): Width of the input image.
106106 """
107107 nchan , Ly , Lx = imgi .shape
108108 if augment :
@@ -859,10 +859,8 @@ def pad_image_ND(img0, div=16, extra=1, min_size=None, zpad=False):
859859 min_size (tuple, optional): Minimum size of the image. Defaults to None.
860860
861861 Returns:
862- tuple containing
863- - I (ndarray): Padded image.
864- - ysub (ndarray): Y range of pixels in the padded image corresponding to img0.
865- - xsub (ndarray): X range of pixels in the padded image corresponding to img0.
862+ A tuple containing (I, ysub, xsub) or (I, ysub, xsub, zsub), I is padded image, -sub are ranges of pixels in the padded image corresponding to img0.
863+
866864 """
867865 Ly , Lx = img0 .shape [- 2 :]
868866 ypad1 , ypad2 , xpad1 , xpad2 = get_pad_yx (Ly , Lx , div = div , extra = extra , min_size = min_size )
@@ -910,10 +908,9 @@ def random_rotate_and_resize(X, Y=None, scale_range=1., xy=(224, 224), do_3D=Fal
910908 random_per_image (bool, optional): Different random rotate and resize per image. Defaults to True.
911909
912910 Returns:
913- tuple containing
914- - imgi (ND-array, float): Transformed images in array [nimg x nchan x xy[0] x xy[1]].
915- - lbl (ND-array, float): Transformed labels in array [nimg x nchan x xy[0] x xy[1]].
916- - scale (array, float): Amount each image was resized by.
911+ A tuple containing (imgi, lbl, scale): imgi (ND-array, float): Transformed images in array [nimg x nchan x xy[0] x xy[1]];
912+ lbl (ND-array, float): Transformed labels in array [nimg x nchan x xy[0] x xy[1]];
913+ scale (array, float): Amount each image was resized by.
917914 """
918915 scale_range = max (0 , min (2 , float (scale_range )))
919916 nimg = len (X )
0 commit comments