""" Dummy interface with the segmentation model """
from typing import List
import numpy as np
from .seg_base import SegBase


class SegDummy(SegBase):
    """ Class for segmentation dummy interface """
    def __init__(self, _home: str) -> None:
        # init method for consistent API
        return

    def convert_rect_to_poly(
            self, imgs: List[np.ndarray],
            bboxes: List[List[float]]) -> List[List[List[float]]]:
        """ predict rectangles -> dummy polygons """
        output: List[List[List[float]]] = []
        for bbox in bboxes:
            x0, y0, w, h = bbox
            # create diamond inscribed in rectangle
            preds = np.array([[w / 2.0, 0], [w, h / 2.0], [w / 2.0, h],
                              [0, h / 2.0]])
            preds += np.array([x0, y0])
            output.append(preds.tolist())
        return output

""" Dummy interface with the segmentation model """
from typing import List
import numpy as np
from .seg_base import SegBase


class SegDummy(SegBase):
    """ Class for segmentation dummy interface """
    def __init__(self, _home: str) -> None:
        # init method for consistent API
        return

    def convert_rect_to_poly(
            self, imgs: List[np.ndarray],
            bboxes: List[List[float]]) -> List[List[List[float]]]:
        """ predict rectangles -> dummy polygons """
        output: List[List[List[float]]] = []
        for bbox in bboxes:
            x0, y0, w, h = bbox
            # create diamond inscribed in rectangle
            preds = np.array([[w / 2.0, 0], [w, h / 2.0], [w / 2.0, h],
                              [0, h / 2.0]])
            preds += np.array([x0, y0])
            output.append(preds.tolist())
        return output

Dummy interface with the segmentation model Class for segmentation dummy interface # init method for consistent API predict rectangles -> dummy polygons # create diamond inscribed in rectangle