def _get_bboxes()

in src/sagemaker_defect_detection/dataset/neu.py [0:0]


    def _get_bboxes(ann: str) -> List[List[int]]:
        tree = ElementTree().parse(ann)
        bboxes = []
        for bndbox in tree.iterfind("object/bndbox"):
            # should subtract 1 like coco?
            bbox = [int(bndbox.findtext(t)) - 1 for t in ("xmin", "ymin", "xmax", "ymax")]  # type: ignore
            assert bbox[2] > bbox[0] and bbox[3] > bbox[1], f"box size error, given {bbox}"
            bboxes.append(bbox)

        return bboxes