concatenate#

concatenate(boxlists: List[NpBoxList], fields: Optional[List[str]] = None) NpBoxList[source]#

Concatenate list of BoxLists.

This op concatenates a list of input BoxLists into a larger BoxList. It also handles concatenation of BoxList fields as long as the field tensor shapes are equal except for the first dimension.

Parameters
  • boxlists (List[BoxList]) – List of BoxList objects.

  • fields (Optional[List[str]]) – Optional list of fields to also concatenate. If None, all fields from the first BoxList in the list are included in the concatenation. Defaults to None.

Returns

A BoxList with number of boxes equal to

sum([boxlist.num_boxes() for boxlist in BoxList])

Return type

BoxList

Raises

ValueError – If boxlists is invalid (i.e., is not a list, is empty, or contains non BoxList objects), or if requested fields are not contained in all boxlists