Open xufabs opened 4 months ago
CheckModelPath() https://github.com/UNeedCryDear/yolov8-opencv-onnxruntime-cpp/blob/813aa9a2d970ea3f93d7db02d55f49b1058a5620/yolov8_utils.cpp#L13 这里面用到部分windows的函数(__access),linux下面没有,这个主要是检测模型路径对不对的,linux下面你可以换掉或者保证下模型路径正确的话可以不要
这段我已经注释掉了,还是有上面的问题,是不是其他地方引用了这段函数,需要一并注释掉?
前面的编译我把函数里引用的都注释掉,编译通过了, 但是我把这段解开注释编译又有问题了orz
如果你不要pose的话,把pose相关的头文件什么的都去掉,包括头文件include之类的,仅仅保留你需要的东西即可(cmake文件也把相关的去掉)
好的,谢谢作者,我在cmakelist里增加上onnxpose.cpp文件就生成了YOLOV8文件了
还有一个问题,如果要推理一段视频,需要将视频文件放在哪里呢?我看video demo 里没有传入视频路径?
我发现那些类里onnx—detect的类是yolov8Poseonnx,无法识别我yolov8n.onnx的文件
所以改用yolov8Onnx这个类,但是推理的效果不太理想,请问是有什么问题?
补充一下,这是我用YOLOV8n POSE.onnx推理的效果 ONNX 1.14 onnxruntime C++ 1.15/1.17我都试过了,没有改善
补充一下,这是我用YOLOV8n POSE.onnx推理的效果 ONNX 1.14 onnxruntime C++ 1.15/1.17我都试过了,没有改善
破案了,我重装了一下yolov8本体的环境就OK了,多谢作者! 之前图方便就conda克隆了yolov10的环境,然后转了onnx模型就出问题了
好的,谢谢作者,我在cmakelist里增加上onnxpose.cpp文件就生成了YOLOV8文件了
你好,请问在哪添加呢,我没有看到这个文件呀
好的,谢谢作者,我在cmakelist里增加上onnxpose.cpp文件就生成了YOLOV8文件了
你好,请问在哪添加呢,我没有看到这个文件呀
在cmakelist文件里,那里有一行写了各种cpp和.h文件的,你把漏编译的cpp和.h 文件放进去就好了
请问make的时候出现以下错误是什么问题呢?我想用它进行ONNXRUNTIME C++(CPU) 推理视频和图片
系统是Ubuntu24
onnxruntime是1.17的 opencv是4.5.3 在conda虚拟环境下编译的 g++是13.2.0
/usr/bin/ld: CMakeFiles/YOLOv8.dir/main.cpp.o: in function, std::allocator > const&, bool, int, bool)'
/usr/bin/ld: main.cpp:(.text._Z11yolov8_onnxI14Yolov8PoseOnnxEiRT_RN2cv3MatERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_Z11yolov8_onnxI14Yolov8PoseOnnxEiRT_RN2cv3MatERKNSt7 cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x1f1): undefined reference to (Yolov8PoseOnnx&, std::cxx11::basic_string<char, std::char_traits, std::allocator >&)':
main.cpp:(.text._Z10video_demoI14Yolov8PoseOnnxEiRT_RNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_Z10video_demoI14Yolov8PoseOnnxEiRT_RNSt7 cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x204): undefined reference to >&)'
/usr/bin/ld: CMakeFiles/YOLOv8.dir/yolov8.cpp.o: in function , std::allocator >)'
/usr/bin/ld: CMakeFiles/YOLOv8.dir/yolov8_onnx.cpp.o: in function cxx11::basic_string<char, std::char_traits, std::allocator >)'
/usr/bin/ld: yolov8_onnx.cpp:(.text+0x22e): undefined reference to , std::allocator >&, bool)':
yolov8_seg.cpp:(.text+0x4a): undefined reference to , std::allocator > const&, bool, int, bool)':
yolov8_seg_onnx.cpp:(.text+0x88): undefined reference to `CheckModelPath(std:: cxx11::basic_string<char, std::char_traits, std::allocator >)'
/usr/bin/ld: yolov8_seg_onnx.cpp:(.text+0x230): undefined reference to `OrtSessionOptionsAppendExecutionProvider_CUDA'
collect2: error: ld returned 1 exit status
make[2]: [CMakeFiles/YOLOv8.dir/build.make:234:YOLOv8] 错误 1
make[1]: [CMakeFiles/Makefile2:83:CMakeFiles/YOLOv8.dir/all] 错误 2
make: *** [Makefile:91:all] 错误 2
int yolov8_onnx<Yolov8PoseOnnx>(Yolov8PoseOnnx&, cv::Mat&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': main.cpp:(.text._Z11yolov8_onnxI14Yolov8PoseOnnxEiRT_RN2cv3MatERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_Z11yolov8_onnxI14Yolov8PoseOnnxEiRT_RN2cv3MatERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x56): undefined reference to
Yolov8PoseOnnx::ReadModel(std::cxx11::basic_string<char, std::char_traitsYolov8PoseOnnx::OnnxDetect(cv::Mat&, std::vector<OutputParams, std::allocator<OutputParams> >&)' /usr/bin/ld: CMakeFiles/YOLOv8.dir/main.cpp.o: in function
int video_demoYolov8PoseOnnx::ReadModel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, int, bool)' /usr/bin/ld: main.cpp:(.text._Z10video_demoI14Yolov8PoseOnnxEiRT_RNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_Z10video_demoI14Yolov8PoseOnnxEiRT_RNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x31d): undefined reference to
Yolov8PoseOnnx::OnnxDetect(cv::Mat&, std::vector<OutputParams, std::allocatorYolov8::ReadModel(cv::dnn::dnn4_v20210608::Net&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool)': yolov8.cpp:(.text+0x4a): undefined reference to
CheckModelPath(std::cxx11::basic_string<char, std::char_traitsYolov8Onnx::ReadModel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, int, bool)': yolov8_onnx.cpp:(.text+0x88): undefined reference to
CheckModelPath(std::OrtSessionOptionsAppendExecutionProvider_CUDA' /usr/bin/ld: CMakeFiles/YOLOv8.dir/yolov8_seg.cpp.o: in function
Yolov8Seg::ReadModel(cv::dnn::dnn4_v20210608::Net&, std::__cxx11::basic_string<char, std::char_traitsCheckModelPath(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)' /usr/bin/ld: CMakeFiles/YOLOv8.dir/yolov8_seg_onnx.cpp.o: in function
Yolov8SegOnnx::ReadModel(std::cxx11::basic_string<char, std::char_traitscmakelist如下