Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I do semantic segmentation on my point cloud? #617

Open
3 tasks done
moe0430cagla opened this issue Sep 6, 2023 · 1 comment
Open
3 tasks done

Can I do semantic segmentation on my point cloud? #617

moe0430cagla opened this issue Sep 6, 2023 · 1 comment
Labels
question Further information is requested

Comments

@moe0430cagla
Copy link

moe0430cagla commented Sep 6, 2023

Checklist

My Question

The following code is written in the README file.

# load the parameters.
pipeline.load_ckpt(ckpt_path=ckpt_path)

test_split = dataset.get_split("test")
data = test_split.get_data(0)

# run inference on a single example.
# returns dict with 'predict_labels' and 'predict_scores'.
result = pipeline.run_inference(data)

I want to use pipeline.run_inference to my own data that doesn't have labels.
Is it possible ?

When I enter my point cloud in the [data] section, I get the following error

torch.tensor(data['label']), model.cfg.num_classes,
KeyError: 'label'

My CODE

pcd = o3d.io.read_point_cloud("../pointcloud/test.ply")
points = np.asarray(pcd.points)
data = {
    'point': points,
    'feat': None,  
}
result = pipeline.run_inference(data)

Please tell me the reason why this error occurs.
Thank you for your cooperation.

@moe0430cagla moe0430cagla added the question Further information is requested label Sep 6, 2023
@sec-morikawa
Copy link

sec-morikawa commented Nov 10, 2023

Hey, @moe0430cagla

It seems you need to add a label Key to your test data.
This is the code when creating an existing dataset (SemanticKITTI).
https://github.com/isl-org/Open3D-ML/blob/master/ml3d/datasets/semantickitti.py#L268

e.g

labels = np.zeros(np.shape(points)[0], dtype=np.int32)
data = {
            'point': points,
            'feat': None,
            'label': labels,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants