MCPcopy Create free account
hub / github.com/Zhiyuan-R/Tiger-Diffusion / create_pointnet_components

Function create_pointnet_components

model/tiger.py:47–70  ·  view source on GitHub ↗
(blocks, in_channels, embed_dim, with_se=False, normalize=True, eps=0,
                               width_multiplier=1, voxel_resolution_multiplier=1)

Source from the content-addressed store, hash-verified

45
46
47def create_pointnet_components(blocks, in_channels, embed_dim, with_se=False, normalize=True, eps=0,
48 width_multiplier=1, voxel_resolution_multiplier=1):
49 r, vr = width_multiplier, voxel_resolution_multiplier
50
51 layers, concat_channels = [], 0
52 c = 0
53 for k, (out_channels, num_blocks, voxel_resolution) in enumerate(blocks):
54 out_channels = int(r * out_channels)
55 for p in range(num_blocks):
56 attention = k % 2 == 0 and k > 0 and p == 0
57 if voxel_resolution is None:
58 block = SharedMLP
59 else:
60 block = functools.partial(PVConv, kernel_size=3, resolution=int(vr * voxel_resolution), attention=attention,
61 with_se=with_se, normalize=normalize, eps=eps)
62
63 if c == 0:
64 layers.append(block(in_channels, out_channels))
65 else:
66 layers.append(block(in_channels+embed_dim, out_channels))
67 in_channels = out_channels
68 concat_channels += out_channels
69 c += 1
70 return layers, in_channels, concat_channels
71
72
73def create_pointnet2_sa_components(sa_blocks, extra_feature_channels, embed_dim=64, use_att=False,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected