MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / __call__

Method __call__

monai/apps/detection/transforms/array.py:461–472  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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
475class SpatialCropBox(SpatialCrop):

Callers

nothing calls this directly

Calls 1

convert_mask_to_boxFunction · 0.85

Tested by

no test coverage detected