import numpy.typing as npt
from code_loader.contract.enums import LeapDataType
@dataclass
class LeapImageWithBBox:
data: npt.NDArray[np.float32]
bbox: npt.NDArray[np.float32]
type: LeapDataType = LeapDataType.ImageWithBBox
from code_loader.contract.visualizer_classes import LeapImageWithBBox
import numpy as np
...
def bb_image_visualizer(image_input: np.ndarray, bbox: np.ndarray) -> LeapImageWithBBox:
return LeapImageWithBBox(data=image_input, bbox=bbox)
leap_binder.set_visualizer(
name='bounding_boxes',
function=bb_image_visualizer,
visualizer_type=LeapImageWithBBox.type
)