MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / cat

Method cat

PATH/core/models/ops/boxes.py:277–294  ·  view source on GitHub ↗

Concatenates a list of Boxes into a single Boxes Arguments: boxes_list (list[Boxes]) Returns: Boxes: the concatenated Boxes

(cls, boxes_list: List["Boxes"])

Source from the content-addressed store, hash-verified

275
276 @classmethod
277 def cat(cls, boxes_list: List["Boxes"]) -> "Boxes":
278 """
279 Concatenates a list of Boxes into a single Boxes
280
281 Arguments:
282 boxes_list (list[Boxes])
283
284 Returns:
285 Boxes: the concatenated Boxes
286 """
287 assert isinstance(boxes_list, (list, tuple))
288 if len(boxes_list) == 0:
289 return cls(torch.empty(0))
290 assert all([isinstance(box, Boxes) for box in boxes_list])
291
292 # use torch.cat (v.s. layers.cat) so the returned boxes never share storage with input
293 cat_boxes = cls(torch.cat([b.tensor for b in boxes_list], dim=0))
294 return cat_boxes
295
296 @property
297 def device(self) -> device:

Callers 15

extractMethod · 0.45
re_rankingFunction · 0.45
computeMethod · 0.45
convertMethod · 0.45
catFunction · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45

Calls 1

emptyMethod · 0.45

Tested by 4

extractMethod · 0.36
all_gatherMethod · 0.36
evaluateMethod · 0.36
evaluateMethod · 0.36