open-mmlab / mmdeploy

OpenMMLab Model Deployment Framework
https://mmdeploy.readthedocs.io/en/latest/
Apache License 2.0
2.77k stars 636 forks source link

How to use numpy array instead of files when use mmdetection3d in mmdeploy #2626

Open cat722 opened 10 months ago

cat722 commented 10 months ago

Checklist

Describe the bug

I successfully generated a tensorrt engine with mmdeploy using the weights and configuration from mmdetection3d. And I have successfully infer use the following code:

image = '/demo/data/nuscenes/n015-2018-07-24-11-22-45+0800__LIDAR_TOP__1532402927647951.pcd.bin'
# build task and backend model
task_processor = build_task_processor(model_cfg, deploy_cfg, device)
model = task_processor.build_backend_model(backend_model)

# process input image
input_shape = get_input_shape(deploy_cfg)
model_inputs, _ = task_processor.create_input(image, input_shape)

# do model inference
with torch.no_grad():
    result = model.test_step(model_inputs)

I want to know how to use numpy array instead of files like image =' ...'

Reproduction

image = '/demo/data/nuscenes/n015-2018-07-24-11-22-45+0800__LIDAR_TOP__1532402927647951.pcd.bin'

Environment

as the guide

Error traceback

No response

artificialzjy commented 18 hours ago

I want to ask how to set the data_path when running tools/deploy.py on KITTI datasets for KITTI datasets have no files of ".pcd.bin" format.