mmdeploy: c++ sdk detection for instance segmentation [Bug]
Checklist
- I have searched related issues but cannot get the expected help.
- 2. I have read the FAQ documentation but cannot get the expected help.
- 3. The bug has not been fixed in the latest version.
Describe the bug
when i use the c++ sdk detection for instance segmentation(by my dataset),the mask is none ,then i try the coco dataes,but the same,the model is rtmdet,the sample is c++ detection sample ,
save image has no mask,
deploy the model,get the follow img:
when use c++ sdk:
the c++ code:
`
#include <cstdlib>
#include <opencv2/opencv.hpp>
#include “mmdeploy/detector.hpp”
#include <chrono>
#include “visualize.h”
int main() { const char* device_name = “cpu”; int device_id = 0; std::string model_path = “/home/a/mmdeploy_model/rtmdetins-s-onnx-gf”; std::string image_path = “/home/a/mmdeploy/demo/resources/det.jpg”; mmdeploy::Model model(model_path); mmdeploy::Detector detector(model, mmdeploy::Device{device_name, device_id}); cv::Mat img = cv::imread(image_path); auto dets = detector.Apply(img); //code det.mask seem none utils::Visualize v; auto sess = v.get_session(img); int count = 0; for (const mmdeploy_detection_t& det : dets) { if (det.score > 0.6) { // filter bboxes sess.add_det(det.bbox, det.label_id, det.score, det.mask, count++); } } cv::imwrite(“out.png”, sess.get()); return 0; } `
Reproduction
c++,just run the given model pth.
Environment
08/05 13:06:11 - mmengine - INFO - **********Environmental information**********
/bin/sh: 1: /usr/local/cuda-11.4/bin/bin/nvcc: not found
/bin/sh: 1: /usr/local/cuda-11.4/bin/bin/nvcc: not found
08/05 13:06:12 - mmengine - INFO - sys.platform: linux
08/05 13:06:12 - mmengine - INFO - Python: 3.9.17 (main, Jul 5 2023, 20:41:20) [GCC 11.2.0]
08/05 13:06:12 - mmengine - INFO - CUDA available: True
08/05 13:06:12 - mmengine - INFO - numpy_random_seed: 2147483648
08/05 13:06:12 - mmengine - INFO - GPU 0: NVIDIA GeForce RTX 3090
08/05 13:06:12 - mmengine - INFO - CUDA_HOME: /usr/local/cuda-11.4/bin
08/05 13:06:12 - mmengine - INFO - NVCC: Not Available
08/05 13:06:12 - mmengine - INFO - GCC: gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
08/05 13:06:12 - mmengine - INFO - PyTorch: 1.12.1+cu116
08/05 13:06:12 - mmengine - INFO - PyTorch compiling details: PyTorch built with:
- GCC 9.3
- C++ Version: 201402
- Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications
- Intel(R) MKL-DNN v2.6.0 (Git Hash 52b5f107dd9cf10910aaa19cb47f3abf9b349815)
- OpenMP 201511 (a.k.a. OpenMP 4.5)
- LAPACK is enabled (usually provided by MKL)
- NNPACK is enabled
- CPU capability usage: AVX2
- CUDA Runtime 11.6
- NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86
- CuDNN 8.3.2 (built against CUDA 11.5)
- Magma 2.6.1
- Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.6, CUDNN_VERSION=8.3.2, CXX_COMPILER=/opt/rh/devtoolset-9/root/usr/bin/c++, CXX_FLAGS= -fabi-version=11 -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.12.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=OFF, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, USE_ROCM=OFF,
08/05 13:06:12 - mmengine - INFO - TorchVision: 0.13.1+cu116
08/05 13:06:12 - mmengine - INFO - OpenCV: 4.8.0
08/05 13:06:12 - mmengine - INFO - MMEngine: 0.8.2
08/05 13:06:12 - mmengine - INFO - MMCV: 2.0.1
08/05 13:06:12 - mmengine - INFO - MMCV Compiler: GCC 9.3
08/05 13:06:12 - mmengine - INFO - MMCV CUDA Compiler: 11.6
08/05 13:06:12 - mmengine - INFO - MMDeploy: 1.2.0+92df991
08/05 13:06:12 - mmengine - INFO -
08/05 13:06:12 - mmengine - INFO - **********Backend information**********
08/05 13:06:12 - mmengine - INFO - tensorrt: 8.4.2.4
08/05 13:06:12 - mmengine - INFO - tensorrt custom ops: Available
08/05 13:06:12 - mmengine - INFO - ONNXRuntime: 1.15.1
08/05 13:06:12 - mmengine - INFO - ONNXRuntime-gpu: 1.15.1
08/05 13:06:12 - mmengine - INFO - ONNXRuntime custom ops: Available
08/05 13:06:12 - mmengine - INFO - pplnn: None
08/05 13:06:12 - mmengine - INFO - ncnn: None
08/05 13:06:12 - mmengine - INFO - snpe: None
08/05 13:06:12 - mmengine - INFO - openvino: 2023.0.1
08/05 13:06:12 - mmengine - INFO - torchscript: 1.12.1+cu116
08/05 13:06:12 - mmengine - INFO - torchscript custom ops: NotAvailable
08/05 13:06:12 - mmengine - INFO - rknn-toolkit: None
08/05 13:06:12 - mmengine - INFO - rknn-toolkit2: None
08/05 13:06:12 - mmengine - INFO - ascend: None
08/05 13:06:12 - mmengine - INFO - coreml: None
08/05 13:06:12 - mmengine - INFO - tvm: None
08/05 13:06:12 - mmengine - INFO - vacc: None
08/05 13:06:12 - mmengine - INFO -
08/05 13:06:12 - mmengine - INFO - **********Codebase information**********
08/05 13:06:12 - mmengine - INFO - mmdet: 3.1.0
08/05 13:06:12 - mmengine - INFO - mmseg: None
08/05 13:06:12 - mmengine - INFO - mmpretrain: None
08/05 13:06:12 - mmengine - INFO - mmocr: None
08/05 13:06:12 - mmengine - INFO - mmagic: None
08/05 13:06:12 - mmengine - INFO - mmdet3d: None
08/05 13:06:12 - mmengine - INFO - mmpose: None
08/05 13:06:12 - mmengine - INFO - mmrotate: None
08/05 13:06:12 - mmengine - INFO - mmaction: None
08/05 13:06:12 - mmengine - INFO - mmrazor: None
08/05 13:06:12 - mmengine - INFO - mmyolo: None
Error traceback
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 64 (42 by maintainers)
hi, https://github.com/open-mmlab/mmdeploy/issues/2334 is not merged. You should clone it and build from source.
git clone --recursive -b fix_rtmdet_inst https://github.com/RunningLeon/mmdeploy.git