Args: boxes_mask: int16 array, sized (num_box, H, W). Each channel represents a box. The foreground region in channel c has intensity of labels[c]. The background intensity is bg_label. Return: - bounding boxes, Nx4 or Nx6 tor
(self, boxes_mask: NdarrayOrTensor)
| 459 | self.label_dtype = label_dtype |
| 460 | |
| 461 | def __call__(self, boxes_mask: NdarrayOrTensor) -> tuple[NdarrayOrTensor, NdarrayOrTensor]: |
| 462 | """ |
| 463 | Args: |
| 464 | boxes_mask: int16 array, sized (num_box, H, W). Each channel represents a box. |
| 465 | The foreground region in channel c has intensity of labels[c]. |
| 466 | The background intensity is bg_label. |
| 467 | |
| 468 | Return: |
| 469 | - bounding boxes, Nx4 or Nx6 torch tensor or ndarray. The box mode is assumed to be ``StandardMode``. |
| 470 | - classification foreground(fg) labels, dtype should be int, sized (N,). |
| 471 | """ |
| 472 | return convert_mask_to_box(boxes_mask, self.bg_label, self.box_dtype, self.label_dtype) |
| 473 | |
| 474 | |
| 475 | class SpatialCropBox(SpatialCrop): |
nothing calls this directly
no test coverage detected