bdlb/diabetic_retinopathy_diagnosis/tfds_adapter.py
def _get_radius(img: np.ndarray, scale: int) -> np.ndarray:
    """Returns radius of the circle to use.

    Args:
      img: `numpy.ndarray`, an image, with shape [height, width, 3].
      scale: `int`, the radius of the neighborhood.

    Returns:
      A resized image.
    """
    x = img[img.shape[0] // 2, ...].sum(axis=1)
    r = 0.5 * (x > x.mean() // 10).sum()
    s = scale * 1.0 / r
    return cv2.resize(img, (0, 0), fx=s, fy=s)
Returns radius of the circle to use.

    Args:
      img: `numpy.ndarray`, an image, with shape [height, width, 3].
      scale: `int`, the radius of the neighborhood.

    Returns:
      A resized image.
    
Returns radius of the circle to use.
Returns radius of the circle to use .
def _get_radius(img: np.ndarray, scale: int) -> np.ndarray:
    x = img[img.shape[0] // 2, ...].sum(axis=1)
    r = 0.5 * (x > x.mean() // 10).sum()
    s = scale * 1.0 / r
    return cv2.resize(img, (0, 0), fx=s, fy=s)
def _get_radius ( img : np . ndarray , scale : int ) -> np . ndarray : x = img [ img . shape [ 0 ] // 2 , ... ] . sum ( axis = 1 ) r = 0.5 * ( x > x . mean ( ) // 10 ) . sum ( ) s = scale * 1.0 / r return cv2 . resize ( img , ( 0 , 0 ) , fx = s , fy = s )
Returns radius of the circle to use.
Returns radius of the circle to use .
"""Returns radius of the circle to use.

    Args:
      img: `numpy.ndarray`, an image, with shape [height, width, 3].
      scale: `int`, the radius of the neighborhood.

    Returns:
      A resized image.
    """
A resized image.
A resized image .
img
np.ndarray
`numpy.ndarray`, an image, with shape [height, width, 3].
` numpy . ndarray ` an image with shape [ height width 3 ] .
scale
int
`int`, the radius of the neighborhood.
` int ` the radius of the neighborhood .