这部分主要是使用c++对Onnx模型进行推理,边先贴代码,过段时间再详细补充下代码说明。
代码主要分成三部分,1.main_obb.cpp推理函数主入口;2.inference_obb.h 头文件及inference_obb.cpp具体函数实现;3.CMakeList.txt.
1.main_obb
推理配置信息全部写在config.txt中,执行代码时会读取该文本中配置信息来进行推理,config.txt格式如下:
rectConfidenceThreshold=0.4
iouThreshold=0.7
imageSize=1024
img_root=/root/inference_CPP/inferenceCPP_2/images
save_root=/root/inference_CPP/inferenceCPP_2/output
modelPath=/root/inference_CPP/inferenceCPP_2/yolov8n-obb.onnx
useGPU=true
classes=0: plane,1: ship, 2: storage tank,3: baseball diamond,4: tennis court,5: basketball court, 6: ground track field,7: harbor,8: bridge,9: large vehicle,10: smal