MCPcopy Create free account
hub / github.com/ADLab-AutoDrive/BEVFusion / test_multi_backbone

Function test_multi_backbone

tests/test_models/test_backbones.py:45–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

43
44
45def test_multi_backbone():
46 if not torch.cuda.is_available():
47 pytest.skip()
48
49 # test list config
50 cfg_list = dict(
51 type='MultiBackbone',
52 num_streams=4,
53 suffixes=['net0', 'net1', 'net2', 'net3'],
54 backbones=[
55 dict(
56 type='PointNet2SASSG',
57 in_channels=4,
58 num_points=(256, 128, 64, 32),
59 radius=(0.2, 0.4, 0.8, 1.2),
60 num_samples=(64, 32, 16, 16),
61 sa_channels=((64, 64, 128), (128, 128, 256), (128, 128, 256),
62 (128, 128, 256)),
63 fp_channels=((256, 256), (256, 256)),
64 norm_cfg=dict(type='BN2d')),
65 dict(
66 type='PointNet2SASSG',
67 in_channels=4,
68 num_points=(256, 128, 64, 32),
69 radius=(0.2, 0.4, 0.8, 1.2),
70 num_samples=(64, 32, 16, 16),
71 sa_channels=((64, 64, 128), (128, 128, 256), (128, 128, 256),
72 (128, 128, 256)),
73 fp_channels=((256, 256), (256, 256)),
74 norm_cfg=dict(type='BN2d')),
75 dict(
76 type='PointNet2SASSG',
77 in_channels=4,
78 num_points=(256, 128, 64, 32),
79 radius=(0.2, 0.4, 0.8, 1.2),
80 num_samples=(64, 32, 16, 16),
81 sa_channels=((64, 64, 128), (128, 128, 256), (128, 128, 256),
82 (128, 128, 256)),
83 fp_channels=((256, 256), (256, 256)),
84 norm_cfg=dict(type='BN2d')),
85 dict(
86 type='PointNet2SASSG',
87 in_channels=4,
88 num_points=(256, 128, 64, 32),
89 radius=(0.2, 0.4, 0.8, 1.2),
90 num_samples=(64, 32, 16, 16),
91 sa_channels=((64, 64, 128), (128, 128, 256), (128, 128, 256),
92 (128, 128, 256)),
93 fp_channels=((256, 256), (256, 256)),
94 norm_cfg=dict(type='BN2d'))
95 ])
96
97 self = build_backbone(cfg_list)
98 self.cuda()
99
100 assert len(self.backbone_list) == 4
101
102 xyz = np.fromfile('tests/data/sunrgbd/points/000001.bin', dtype=np.float32)

Callers

nothing calls this directly

Calls 3

build_backboneFunction · 0.90
cudaMethod · 0.80
viewMethod · 0.80

Tested by

no test coverage detected