(width: int, height: int, distortion_scale: float)
return startpoints, endpoints
Get parameters for ``perspective`` for a random perspective transform.

        Args:
            width (int): width of the image.
            height (int): height of the image.
            distortion_scale (float): argument to control the degree of distortion and ranges from 0 to 1.

        Returns:
            List containing [top-left, top-right, bottom-right, bottom-left] of the original image,
            List containing [top-left, top-right, bottom-right, bottom-left] of the transformed image.
Get parameters for ``perspective`` for a random perspective transform.
Get parameters for perspective for a random perspective transform .
def get_params(width: int, height: int, distortion_scale: float) -> Tuple[
            List[List[int]], List[List[int]]]:
        """Get parameters for ``perspective`` for a random perspective transform.

        Args:
            width (int): width of the image.
            height (int): height of the image.
            distortion_scale (float): argument to control the degree of distortion and ranges from 0 to 1.

        Returns:
            List containing [top-left, top-right, bottom-right, bottom-left] of the original image,
            List containing [top-left, top-right, bottom-right, bottom-left] of the transformed image.
        """
        half_height = height // 2
        half_width = width // 2
        topleft = [
            int(
                torch.randint(
                    0, int(distortion_scale * half_width) + 1, size=(1, ))
                .item()), int(
                    torch.randint(
                        0, int(distortion_scale * half_height) + 1, size=(1, ))
                    .item())
        ]
        topright = [
            int(
                torch.randint(
                    width - int(distortion_scale * half_width) - 1,
                    width,
                    size=(1, )).item()),
            int(
                torch.randint(
                    0, int(distortion_scale * half_height) + 1, size=(1, ))
                .item())
        ]
        botright = [
            int(
                torch.randint(
                    width - int(distortion_scale * half_width) - 1,
                    width,
                    size=(1, )).item()), int(
                        torch.randint(
                            height - int(distortion_scale * half_height) - 1,
                            height,
                            size=(1, )).item())
        ]
        botleft = [
            int(
                torch.randint(
                    0, int(distortion_scale * half_width) + 1, size=(1, ))
                .item()), int(
                    torch.randint(
                        height - int(distortion_scale * half_height) - 1,
                        height,
                        size=(1, )).item())
        ]
        startpoints = [[0, 0], [width - 1, 0], [width - 1, height - 1],
                       [0, height - 1]]
        endpoints = [topleft, topright, botright, botleft]
        return startpoints, endpoints
def get_params ( width : int , height : int , distortion_scale : float ) -> Tuple [ List [ List [ int ] ] , List [ List [ int ] ] ] : half_height = height // 2 half_width = width // 2 topleft = [ int ( torch . randint ( 0 , int ( distortion_scale * half_width ) + 1 , size = ( 1 , ) ) . item ( ) ) , int ( torch . randint ( 0 , int ( distortion_scale * half_height ) + 1 , size = ( 1 , ) ) . item ( ) ) ] topright = [ int ( torch . randint ( width - int ( distortion_scale * half_width ) - 1 , width , size = ( 1 , ) ) . item ( ) ) , int ( torch . randint ( 0 , int ( distortion_scale * half_height ) + 1 , size = ( 1 , ) ) . item ( ) ) ] botright = [ int ( torch . randint ( width - int ( distortion_scale * half_width ) - 1 , width , size = ( 1 , ) ) . item ( ) ) , int ( torch . randint ( height - int ( distortion_scale * half_height ) - 1 , height , size = ( 1 , ) ) . item ( ) ) ] botleft = [ int ( torch . randint ( 0 , int ( distortion_scale * half_width ) + 1 , size = ( 1 , ) ) . item ( ) ) , int ( torch . randint ( height - int ( distortion_scale * half_height ) - 1 , height , size = ( 1 , ) ) . item ( ) ) ] startpoints = [ [ 0 , 0 ] , [ width - 1 , 0 ] , [ width - 1 , height - 1 ] , [ 0 , height - 1 ] ] endpoints = [ topleft , topright , botright , botleft ] return startpoints , endpoints