def METHOD_NAME(self, obj: VisText, frame_shape) -> Tuple[int, int]:
    """
    Get relative position of the text w.r.t. the bounding box.
    If bbox is None,the position is relative to the frame.
    """
    if obj.bbox is None:
        obj.bbox = BoundingBox()
    text_config = self.config.text
    tl, br = obj.bbox.denormalize(frame_shape)
    shape = br[0] - tl[0], br[1] - tl[1]
    bbox_arr = obj.bbox.to_tuple(frame_shape)
    font_scale = obj.size or text_config.font_scale
    if obj.size is None and text_config.auto_scale:
        self.get_text_scale(shape, bbox_arr)
    text_width, text_height = 0, 0
    for text in obj.text.splitlines():
        text_size = cv2.getTextSize(text=text,
                                    fontFace=text_config.font_face,
                                    fontScale=font_scale,
                                    thickness=text_config.font_thickness)[0]
        text_width = max(text_width, text_size[0])
        text_height += text_size[1]
    x, y = bbox_arr[0], bbox_arr[1]
    y_pos = obj.position.value % 10
    if y_pos == 0:  # Y top
        y = bbox_arr[1] + text_height + obj.padding
    elif y_pos == 1:  # Y mid
        y = (bbox_arr[1] + bbox_arr[3]) // 2 + text_height // 2
    elif y_pos == 2:  # Y bottom
        y = bbox_arr[3] - text_height - obj.padding
    x_pos = obj.position.value // 10
    if x_pos == 0:  # X Left
        x = bbox_arr[0] + obj.padding
    elif x_pos == 1:  # X mid
        x = (bbox_arr[0] + bbox_arr[2]) // 2 - text_width // 2
    elif x_pos == 2:  # X right
        x = bbox_arr[2] - text_width - obj.padding
    return x, y