MCPcopy
hub / github.com/hustvl/Vim / cat

Method cat

det/detectron2/structures/boxes.py:279–296  ·  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

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

Callers 15

func_catMethod · 0.95
broadcatFunction · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
interpolate_pos_embedFunction · 0.45
forward_featuresMethod · 0.45
train_one_epochFunction · 0.45
mainFunction · 0.45
load_checkpointFunction · 0.45
causal_conv1d_refFunction · 0.45
causal_conv1d_update_refFunction · 0.45

Calls

no outgoing calls

Tested by 13

func_catMethod · 0.76
_get_augmented_boxesMethod · 0.36
_get_augmented_boxesMethod · 0.36
random_rotated_boxesFunction · 0.36
test_script_catMethod · 0.36
test_empty_catMethod · 0.36
test_scriptabilityMethod · 0.36
test_empty_catMethod · 0.36
test_scriptabilityMethod · 0.36
benchmark_pasteFunction · 0.36