(shape, margin, bbox_shape)
return (t, l, h, w)
Generate a random tlhw with configuration.

        Args:
            config: Config should have configuration including IMG_SHAPES,
                VERTICAL_MARGIN, HEIGHT, HORIZONTAL_MARGIN, WIDTH.

        Returns:
            tuple: (top, left, height, width)
Generate a random tlhw with configuration.
Generate a random tlhw with configuration .
def random_bbox(shape, margin, bbox_shape):
        """Generate a random tlhw with configuration.

        Args:
            config: Config should have configuration including IMG_SHAPES,
                VERTICAL_MARGIN, HEIGHT, HORIZONTAL_MARGIN, WIDTH.

        Returns:
            tuple: (top, left, height, width)

        """
        img_height = shape[0]
        img_width = shape[1]
        height, width = bbox_shape
        ver_margin, hor_margin = margin
        maxt = img_height - ver_margin - height
        maxl = img_width - hor_margin - width
        t = np.random.randint(low=ver_margin, high=maxt)
        l = np.random.randint(low=hor_margin, high=maxl)
        h = height
        w = width
        return (t, l, h, w)
def random_bbox ( shape , margin , bbox_shape ) : img_height = shape [ 0 ] img_width = shape [ 1 ] height , width = bbox_shape ver_margin , hor_margin = margin maxt = img_height - ver_margin - height maxl = img_width - hor_margin - width t = np . random . randint ( low = ver_margin , high = maxt ) l = np . random . randint ( low = hor_margin , high = maxl ) h = height w = width return ( t , l , h , w )