init_detector(config_file, checkpoint_file, device='cuda:0') # 测试单张图片并展示结果 img = os.path.join(base_dir, r'demo\demo.jpg') # 或者 img = mmcv.imread(img),这样图片仅会被读一次 result = inference_detector(model, img) # 在一个新的窗口中将结果可视化 model.show_result(img, ...
最后再利用官方提供的Demo,先下载预训练模型(下载链接)放至test_demo\checkpoints文件下,然后运行下面代码: import osfrom mmdet3d.apis import inference_detector, init_model, show_result_meshlabdef demo_mmdet3d():base_dir = r'D:\Program Files\Third_Part_Lib\mmdetection3d' # mmdetection3d的安装目录co...
result, data = inference_detector(model, args.pcd) File "/home/y202729/mmdetection3d/mmdet3d/apis/inference.py", line 116, in inference_detector result = model(return_loss=False, rescale=True, **data) File "/home/y202729/tools/miniconda3/envs/mmdet/lib/python3.7/site-packages/torch/nn/...
在这个例子中,init_detector函数不仅构建了模型,还加载了指定的预训练权重,并准备好了设备(如GPU)。然后,你可以使用inference_detector函数对输入图像进行推理,并使用show_result_pyplot函数来显示检测结果。 综上所述,build_detector函数是mmdetection框架中一个非常有用的工具,它允许你根据配置文件动态地构建目标检测模型...
BEVFormer is a camera-based detector using BEV features transformed from multiview images, which achieves SOTA performance on Waymo and nusenes. It is beneficial to have a close insight of its inference performance after being deployed on backend TensorRT. ...
'onnx.onnx_cpp2py_export.shape_inference', 'onnx.onnx_cpp2py_export', 'google.protobuf', 'google.protobuf.internal', 'six', 'google.protobuf.internal.enum_type_wrapper', 'google.protobuf.internal._api_implementation', 'google.protobuf.internal.api_implementation', 'google.protobuf.pyext...