MCPcopy Create free account
hub / github.com/PeizeSun/SparseR-CNN / get_regular_bitmask_instances

Function get_regular_bitmask_instances

tests/modeling/test_model_e2e.py:42–48  ·  view source on GitHub ↗
(h, w)

Source from the content-addressed store, hash-verified

40
41
42def get_regular_bitmask_instances(h, w):
43 inst = Instances((h, w))
44 inst.gt_boxes = Boxes(torch.rand(3, 4))
45 inst.gt_boxes.tensor[:, 2:] += inst.gt_boxes.tensor[:, :2]
46 inst.gt_classes = torch.tensor([3, 4, 5]).to(dtype=torch.int64)
47 inst.gt_masks = BitMasks((torch.rand(3, h, w) > 0.5))
48 return inst
49
50
51class ModelE2ETest:

Callers 1

test_half_empty_dataMethod · 0.85

Calls 4

InstancesClass · 0.90
BoxesClass · 0.90
BitMasksClass · 0.90
toMethod · 0.45

Tested by

no test coverage detected