Closed shuxuzhipeng closed 4 years ago
can you post more information? for openpose the post processing code include in this repo.
std::vector
float netOutput = (float ) outputLayersInfo[outputLayerIndex].buffer;
int sizes[] = {46,46};
std::vector
`In file included from /home/ctc/openpose/tensorrt-zoo/openpose/nvdsinfer_openpose_engine.cpp:2:0: /home/ctc/openpose/tensorrt-zoo/openpose/OpenPose.cu:7:10: fatal error: Trt.h: No such file or directory
^~~~~~~
compilation terminated. CMakeFiles/testopenpose.dir/build.make:110: recipe for target 'CMakeFiles/testopenpose.dir/nvdsinfer_openpose_engine.cpp.o' failed make[2]: [CMakeFiles/testopenpose.dir/nvdsinfer_openpose_engine.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/testopenpose.dir/all' failed make[1]: [CMakeFiles/testopenpose.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2 ` i cant make neither
please use some code block for readability, and can you run the correct result with testopenpose?
take a look at https://github.com/zerollzeng/tensorrt-zoo/blob/master/docs/openpose.md and https://github.com/zerollzeng/tensorrt-zoo/blob/master/README.md please make sure your meet all the installation requirements.
`
float netOutput = (float ) outputLayersInfo[outputLayerIndex].buffer;
int sizes[] = {46,46};
std::vector<cv::Mat> netOutputParts;
for(int i=0; i<18; i++){
cv::Mat MatKeypoint(2,sizes,CV_32FC1, netOutput + i*46*46);
std::cout<<"pointer "<< (netOutput + i*46*46)<<std::endl;
cv::Mat resizedPart;
cv::resize(MatKeypoint,resizedPart,cv::Size(333,500));
//cv::Mat smoothProbMap; no difference
//cv::GaussianBlur(resizedPart,smoothProbMap,cv::Size(3,3),0,0);
netOutputParts.push_back(resizedPart);
}
std::vector<KeyPoint> keyPoints;
for(int i=0; i<18; ++i){
//std::vector<KeyPoint> keyPoints;
double maxVal;
cv::Point maxLoc;
cv::minMaxLoc(netOutputParts[i],0,&maxVal,0,&maxLoc);
keyPoints.push_back(KeyPoint(i, maxVal,maxLoc, netOutputParts[i].at<float>(maxLoc.y,maxLoc.x)));
}`
this is my solution to treat output info, i cant pass the compile the error is
/home/ctc/openpose/tensorrt-zoo/openpose/OpenPose.cu:78:147: error: void value not ignored as it ought to be caffeModel, saveEngine, outputBlobName, maxBatchSize, runMode, calibratorData); ^ /home/ctc/openpose/tensorrt-zoo/openpose/OpenPose.cu: In member function ‘void OpenPose::DoInference(std::vector<float>&, std::vector<float>&)’: /home/ctc/openpose/tensorrt-zoo/openpose/OpenPose.cu:114:16: error: expected primary-expression before ‘<’ token Normalize<<<numBlocks, 512 , 0>>>((float*)mpInputGpu); ^ /home/ctc/openpose/tensorrt-zoo/openpose/OpenPose.cu:114:37: error: expected primary-expression before ‘>’ token Normalize<<<numBlocks, 512 , 0>>>((float*)mpInputGpu); ^ /home/ctc/openpose/tensorrt-zoo/openpose/OpenPose.cu:142:27: error: expected primary-expression before ‘<’ token op::resizeKernel<<<numBlocks, threadsPerBlock>>>((float*)mpResizeMapGpu,(float*)mpHeatMapGpu,widthSouce,heightSource,widthTarget,heightTarget); ^ /home/ctc/openpose/tensorrt-zoo/openpose/OpenPose.cu:142:56: error: expected primary-expression before ‘>’ token op::resizeKernel<<<numBlocks, threadsPerBlock>>>((float*)mpResizeMapGpu,(float*)mpHeatMapGpu,widthSouce,heightSource,widthTarget,heightTarget);
take a look at https://github.com/zerollzeng/tensorrt-zoo/blob/master/docs/openpose.md and https://github.com/zerollzeng/tensorrt-zoo/blob/master/README.md please make sure your meet all the installation requirements.
im sure i got all the requirements, i use the jetson xavier nx.
` float netOutput = (float ) outputLayersInfo[outputLayerIndex].buffer;
int sizes[] = {46,46}; std::vector<cv::Mat> netOutputParts; for(int i=0; i<18; i++){ cv::Mat MatKeypoint(2,sizes,CV_32FC1, netOutput + i*46*46); std::cout<<"pointer "<< (netOutput + i*46*46)<<std::endl; cv::Mat resizedPart; cv::resize(MatKeypoint,resizedPart,cv::Size(333,500)); //cv::Mat smoothProbMap; no difference //cv::GaussianBlur(resizedPart,smoothProbMap,cv::Size(3,3),0,0); netOutputParts.push_back(resizedPart); } std::vector<KeyPoint> keyPoints; for(int i=0; i<18; ++i){ //std::vector<KeyPoint> keyPoints; double maxVal; cv::Point maxLoc; cv::minMaxLoc(netOutputParts[i],0,&maxVal,0,&maxLoc); keyPoints.push_back(KeyPoint(i, maxVal,maxLoc, netOutputParts[i].at<float>(maxLoc.y,maxLoc.x))); }`
this is my solution to treat output info, i cant pass the compile the error is
/home/ctc/openpose/tensorrt-zoo/openpose/OpenPose.cu:78:147: error: void value not ignored as it ought to be caffeModel, saveEngine, outputBlobName, maxBatchSize, runMode, calibratorData); ^ /home/ctc/openpose/tensorrt-zoo/openpose/OpenPose.cu: In member function ‘void OpenPose::DoInference(std::vector<float>&, std::vector<float>&)’: /home/ctc/openpose/tensorrt-zoo/openpose/OpenPose.cu:114:16: error: expected primary-expression before ‘<’ token Normalize<<<numBlocks, 512 , 0>>>((float*)mpInputGpu); ^ /home/ctc/openpose/tensorrt-zoo/openpose/OpenPose.cu:114:37: error: expected primary-expression before ‘>’ token Normalize<<<numBlocks, 512 , 0>>>((float*)mpInputGpu); ^ /home/ctc/openpose/tensorrt-zoo/openpose/OpenPose.cu:142:27: error: expected primary-expression before ‘<’ token op::resizeKernel<<<numBlocks, threadsPerBlock>>>((float*)mpResizeMapGpu,(float*)mpHeatMapGpu,widthSouce,heightSource,widthTarget,heightTarget); ^ /home/ctc/openpose/tensorrt-zoo/openpose/OpenPose.cu:142:56: error: expected primary-expression before ‘>’ token op::resizeKernel<<<numBlocks, threadsPerBlock>>>((float*)mpResizeMapGpu,(float*)mpHeatMapGpu,widthSouce,heightSource,widthTarget,heightTarget);
perhaps problem is u dont add nvcc compile? i guess, but i dont know how to add it in cmake file.
is there any other solutions?
nah, this repo was mainly developed under desktop gpu, sry I can't help you with this since it's been a long time
缺少util.h 也没有nvdsinfer_custombboxparser.cu, 我处理推理结果的时候 只是把 57个特征图还原成原图大小, 再去找每一个的最大值, 可是这样的结果 和关键点对不上,请问是处理的方式不对,还是有可能 。engine 或者tensorrt 推理可能有问题? 能发一遍完整的代码吗,想运行出你的效果