(self, pts, colors)
| 191 | |
| 192 | |
| 193 | def forward(self, pts, colors): |
| 194 | # divide the point cloud in the same form. This is important |
| 195 | _, center, features = self.group_divider(pts, colors) |
| 196 | |
| 197 | # encoder the input cloud patches |
| 198 | group_input_tokens = self.encoder(features) # B G N |
| 199 | group_input_tokens = self.encoder2trans(group_input_tokens) |
| 200 | # prepare cls |
| 201 | cls_tokens = self.cls_token.expand(group_input_tokens.size(0), -1, -1) |
| 202 | cls_pos = self.cls_pos.expand(group_input_tokens.size(0), -1, -1) |
| 203 | # add pos embedding |
| 204 | pos = self.pos_embed(center) |
| 205 | # final input |
| 206 | x = torch.cat((cls_tokens, group_input_tokens), dim=1) |
| 207 | pos = torch.cat((cls_pos, pos), dim=1) |
| 208 | # transformer |
| 209 | x = x + pos |
| 210 | # x = x.half() |
| 211 | |
| 212 | # a patch_dropout of 0. would mean it is disabled and this function would do nothing but return what was passed in |
| 213 | x = self.patch_dropout(x) |
| 214 | |
| 215 | x = self.visual.pos_drop(x) |
| 216 | |
| 217 | # ModuleList not support forward |
| 218 | for i, blk in enumerate(self.visual.blocks): |
| 219 | x = blk(x) |
| 220 | x = self.visual.norm(x[:, 0, :]) |
| 221 | x = self.visual.fc_norm(x) |
| 222 | |
| 223 | x = self.trans2embed(x) |
| 224 | return x |
nothing calls this directly
no outgoing calls
no test coverage detected