segmant segmentation predict_labels my own point cloud by using predefind kitti model
- Dominant language
- Python
- Stars
- 2.3k
- Forks
- 365
- Avg merge
- 4h 6m
- Merged PRs (30d)
- 1
Description
### Checklist
- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D-ML/issues).
- [X] I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).
### My Question
I try to predict_labels of my own point cloud. I used predefined kitti model. i run the script by used Cloab.
the output show all points have the same lable nu. 18. Sure that is not logic

`
import os
import open3d.ml as _ml3d
import open3d.ml.torch as ml3d
cfg_file = "/content/Open3D-ML/ml3d/configs/randlanet_semantickitti.yml"
cfg = _ml3d.utils.Config.load_from_file(cfg_file)
model = ml3d.models.RandLANet(**cfg.model)
datapath = '/content/data/velodyne'
dataset = ml3d.datasets.KITTI(dataset_path=datapath, use_cache = True)
pipeline = ml3d.pipelines.SemanticSegmentation(model=model, dataset = dataset, **cfg.pipeline)
# download the weights.
ckpt_folder = "./logs/"
os.makedirs(ckpt_folder, exist_ok=True)
ckpt_path = ckpt_folder + "randlanet_semantickitti_202201071330utc.pth"
randlanet_url = "https://storage.googleapis.com/open3d-releases/model-zoo/randlanet_semantickitti_202201071330utc.pth"
if not os.path.exists(ckpt_path):
cmd = "wget {} -O {}".format(randlanet_url, ckpt_path)
os.system(cmd)
# load the parameters.
pipeline.load_ckpt(ckpt_path=ckpt_path)
import numpy as np
import open3d as o3d
data_viz = {}
filepath='/content/drive/MyDrive/L001.xyz'
#point_cloud= np.loadtxt(filepath,skiprows=1)
point_cloud= np.loadtxt(filepath)
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(point_cloud[:,:3])
label = np.zeros((len(pcd.points), 1))
data = {
'point': np.asarray(pcd.points) , # your point cloud, an nx3 numpy array
'label': label
}
# returns dict with 'predict_labels' and 'predict_scores'.
result = pipeline.run_inference(data)
from numpy.lib.arraysetops import unique
pred_label = (result['predict_labels'] ).astype(np.int32)
pred_label
`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the RandLANet SemanticKITTI configuration and the SemanticSegmentation pipeline around run_inference, then compare the KITTI dataset assumptions with the supplied XYZ point cloud and its preprocessing. Reproduce the result using the shown checkpoint and inspect predict_labels and predict_scores. Done means identifying a documented input or model mismatch, or producing a confirmed reproducible defect with the expected output described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- computer-vision, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100