BoxList#

class BoxList[source]#

Bases: object

__init__(boxes: torch.Tensor, format: str = 'xyxy', **extras) None[source]#

Representation of a list of bounding boxes and associated data.

Internally, boxes are always stored in the xyxy format.

Parameters
  • boxes (torch.Tensor) – tensor<n, 4>

  • format (str) – format of input boxes.

  • extras – dict with values that are tensors with first dimension corresponding to boxes first dimension

Return type

None

Methods

__init__(boxes[, format])

Representation of a list of bounding boxes and associated data.

cat(box_lists)

clip_boxes(img_height, img_width)

convert_boxes(out_fmt)

copy()

equal(other)

get_field(name)

ind_filter(inds)

nms([iou_thresh])

pin_memory()

scale(yscale, xscale)

Scale box coords by the given scaling factors.

score_filter([score_thresh])

to(*args, **kwargs)

Recursively apply torch.Tensor.to() to Tensors.

__contains__(key: str) bool[source]#
Parameters

key (str) –

Return type

bool

__init__(boxes: torch.Tensor, format: str = 'xyxy', **extras) None[source]#

Representation of a list of bounding boxes and associated data.

Internally, boxes are always stored in the xyxy format.

Parameters
  • boxes (torch.Tensor) – tensor<n, 4>

  • format (str) – format of input boxes.

  • extras – dict with values that are tensors with first dimension corresponding to boxes first dimension

Return type

None

static cat(box_lists: Iterable[BoxList]) BoxList[source]#
Parameters

box_lists (Iterable[BoxList]) –

Return type

BoxList

clip_boxes(img_height: int, img_width: int) BoxList[source]#
Parameters
  • img_height (int) –

  • img_width (int) –

Return type

BoxList

convert_boxes(out_fmt: str) torch.Tensor[source]#
Parameters

out_fmt (str) –

Return type

torch.Tensor

copy() BoxList[source]#
Return type

BoxList

equal(other: BoxList) bool[source]#
Parameters

other (BoxList) –

Return type

bool

get_field(name: str) Any[source]#
Parameters

name (str) –

Return type

Any

ind_filter(inds: Sequence[int]) BoxList[source]#
Parameters

inds (Sequence[int]) –

Return type

BoxList

nms(iou_thresh: float = 0.5) torch.Tensor[source]#
Parameters

iou_thresh (float) –

Return type

torch.Tensor

pin_memory() BoxList[source]#
Return type

BoxList

scale(yscale: float, xscale: float) BoxList[source]#

Scale box coords by the given scaling factors.

Parameters
Return type

BoxList

score_filter(score_thresh: float = 0.25) BoxList[source]#
Parameters

score_thresh (float) –

Return type

BoxList

to(*args, **kwargs) BoxList[source]#

Recursively apply torch.Tensor.to() to Tensors.

Parameters
Returns

New BoxList with to’d Tensors.

Return type

BoxList