You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The transform method of the RandLANet class is currently creating copies of the input data before sampling points. This significantly impacts performance, especially when dealing with large pointcloud files containing millions of points.
Move the copy() operations to after the point sampling. The point sampler doesn't perform any in-place operations on the pc array, so it shouldn't have any side effects on the original pointcloud.
pc=data["point"] # full pointcloud (N,3)label=data["label"]
feat=data["feat"] ifdata["feat"] isnotNoneelseNonetree=data["search_tree"]
selected_idxs, center_point=self.trans_point_sampler(
pc=pc,
feat=feat,
label=label,
search_tree=tree,
num_points=self.cfg.num_points,
sampler=self.cfg.get("sampler", None),
) # Points are sampled from the whole pointcloud (n_points,3)pc_sub=pc[selected_idxs]
pc=pc_sub.copy()
label_sub=label[selected_idxs]
label=label_sub.copy()
iffeatisnotNone:
feat_sub=feat[selected_idxs]
feat=feat_sub.copy()
random.shuffle(idxs)
returnidxs, center_point
References
No response
Additional information
Performance Improvement
I have run performance tests on both the current and proposed implementations, running a single epoch with this configuration ml3d/configs/randlanet_toronto3d.yml .
The text was updated successfully, but these errors were encountered:
Checklist
main
branch).Proposed new feature or change
Current Behavior
The
transform
method of theRandLANet
class is currently creating copies of the input data before sampling points. This significantly impacts performance, especially when dealing with large pointcloud files containing millions of points.Open3D-ML/ml3d/torch/models/randlanet.py
Lines 170 to 185 in 473592d
Open3D-ML/ml3d/datasets/samplers/semseg_random.py
Lines 51 to 53 in 473592d
Proposed Change
Move the
copy()
operations to after the point sampling. The point sampler doesn't perform any in-place operations on thepc
array, so it shouldn't have any side effects on the original pointcloud.References
No response
Additional information
Performance Improvement
I have run performance tests on both the current and proposed implementations, running a single epoch with this configuration ml3d/configs/randlanet_toronto3d.yml .
The text was updated successfully, but these errors were encountered: