isl-org / isl-org/Open3D-ML

how to get bbox from inference?

Open
#605 0 comments 0 reactions 0 assignees View on GitHub
question
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

If I have understood the documentation correctly, this should return the bounding boxes
```python
import open3d.ml as _ml3d
import open3d.ml.torch as ml3d

cfg_file = "../Open3D-ML/ml3d/configs/pointpillars_kitti.yml"
cfg = _ml3d.utils.Config.load_from_file(cfg_file)

model = ml3d.models.PointPillars(**cfg.model)
cfg.dataset['dataset_path'] = "../Kitti/"
dataset = ml3d.datasets.KITTI(cfg.dataset.pop('dataset_path', None), **cfg.dataset)
pipeline = ml3d.pipelines.ObjectDetection(model, dataset=dataset, device="gpu", **cfg.pipeline)

ckpt_folder = "./logs/"
ckpt_path = ckpt_folder + "pointpillars_kitti_202012221652utc.pth"
pipeline.load_ckpt(ckpt_path=ckpt_path)

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

print(result)
```

but i only get the predicted class and confidence

```
/home/user/miniconda3/envs/try4/lib/python3.7/site-packages/torch/functional.py:504: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at ../aten/src/ATen/native/TensorShape.cpp:3190.)
return _VF.meshgrid(tensors, **kwargs) # type: ignore[attr-defined]
[[box:1 (class=Pedestrian, conf=0.86178064), box:2 (class=Pedestrian, conf=0.36487898), box:3 (class=Pedestrian, conf=0.16163363), box:4 (class=Pedestrian, conf=0.13253418), box:5 (class=Pedestrian, conf=0.10707571), box:6 (class=Cyclist, conf=0.45903814), box:7 (class=Cyclist, conf=0.27264488), box:8 (class=Car, conf=0.6952833), box:9 (class=Car, conf=0.4955058), box:10 (class=Car, conf=0.19803749), box:11 (class=Car, conf=0.12984186), box:12 (class=Car, conf=0.1098452)]]
```

What am I doing wrong and how would you get the bboxes of the predicted objects?
Im sorry for the simple question, I am very much new to Open3D ML and this was not straight forward to me. Other [Blogposts](https://medium.com/@kidargueta/3d-object-detection-with-open3d-ml-and-pytorch-backend-b0870c6f8a85) I found got it working with this setup so I am very confused.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.