nn/unet.py
def is_valid_patch_size(ps):
        """
        Due to the existence of cropping and pooling, U-Net cannot take arbitrary input size
        This function determines if a input size is a valid input size, other wise return closest valid size
        :param ps: input patch size, should be a tuple
        :return: True if ps is valid, otherwise the closest valid input size
        """
        if (ps[0] - 124) % 32 == 0 and (ps[1] - 124) % 32 == 0:
            return True
        else:
            ps_0 = (ps[0] - 124) // 32 + 124
            ps_1 = (ps[1] - 124) // 32 + 124
            return tuple([ps_0, ps_1])

        Due to the existence of cropping and pooling, U-Net cannot take arbitrary input size
        This function determines if a input size is a valid input size, other wise return closest valid size
        :param ps: input patch size, should be a tuple
        :return: True if ps is valid, otherwise the closest valid input size
        
Due to the existence of cropping and pooling, U-Net cannot take arbitrary input size
This function determines if a input size is a valid input size, other wise return closest valid size
Due to the existence of cropping and pooling U - Net cannot take arbitrary input size This function determines if a input size is a valid input size other wise return closest valid size
def is_valid_patch_size(ps):
        if (ps[0] - 124) % 32 == 0 and (ps[1] - 124) % 32 == 0:
            return True
        else:
            ps_0 = (ps[0] - 124) // 32 + 124
            ps_1 = (ps[1] - 124) // 32 + 124
            return tuple([ps_0, ps_1])
def is_valid_patch_size ( ps ) : if ( ps [ 0 ] - 124 ) % 32 == 0 and ( ps [ 1 ] - 124 ) % 32 == 0 : return True else : ps_0 = ( ps [ 0 ] - 124 ) // 32 + 124 ps_1 = ( ps [ 1 ] - 124 ) // 32 + 124 return tuple ( [ ps_0 , ps_1 ] )
Due to the existence of cropping and pooling, U-Net cannot take arbitrary input size
This function determines if a input size is a valid input size, other wise return closest valid size
Due to the existence of cropping and pooling U - Net cannot take arbitrary input size This function determines if a input size is a valid input size other wise return closest valid size
"""
        Due to the existence of cropping and pooling, U-Net cannot take arbitrary input size
        This function determines if a input size is a valid input size, other wise return closest valid size
        :param ps: input patch size, should be a tuple
        :return: True if ps is valid, otherwise the closest valid input size
        """
True if ps is valid, otherwise the closest valid input size
True if ps is valid otherwise the closest valid input size
ps
input patch size, should be a tuple
input patch size should be a tuple