simple
Single forward-pass inference over the whole scene.
Classes:
-
SimpleInfererβDirect call to the predictor on the whole scene.
SimpleInferer [source] ΒΆ
Bases: Inferer
Direct call to the predictor on the whole scene.
The lightest possible Inferer. Use when the model can consume the entire point cloud in one forward pass (object classification, small scenes).
Parameters:
-
softmax(bool, default:False) βIf
True, softmax the predictor output over the last dim before returning it. The default returns the predictor output unchanged.
Example
import torch
import torch_pointcloud as tp
from torch_pointcloud.inferers import SimpleInferer
model = tp.create_model("pointnet.s3dis-area5").eval()
data = {
"pos": torch.rand(4096, 3) * 10,
"x": torch.rand(4096, 9),
"batch": torch.zeros(4096, dtype=torch.long),
}
inferer = SimpleInferer()
logits = inferer(data, predictor=lambda d: model(d["x"], d["pos"], d["batch"]))