BoxList#

class BoxList[source]#

Bases: object

__init__(boxes: 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 (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: 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 (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[Self]) Self[source]#
Parameters

box_lists (Iterable[Self]) –

Return type

Self

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

  • img_width (int) –

Return type

Self

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

out_fmt (str) –

Return type

Tensor

copy() Self[source]#
Return type

Self

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

other (Self) –

Return type

bool

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

name (str) –

Return type

Any

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

inds (Sequence[int]) –

Return type

Self

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

iou_thresh (float) –

Return type

Tensor

pin_memory() Self[source]#
Return type

Self

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

Scale box coords by the given scaling factors.

Parameters
Return type

Self

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

score_thresh (float) –

Return type

Self

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

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

Parameters
Returns

New BoxList with to’d Tensors.

Return type

BoxList