Fully working YOLOv8 detection with ONNX runtime.

This commit is contained in:
Tuomas Järvinen
2024-07-14 18:08:05 +02:00
parent 78cfe484b1
commit 813251b170
13 changed files with 678 additions and 49 deletions
+13 -4
View File
@@ -17,14 +17,23 @@ opi5 {
LIBS += /usr/local/lib/librknnrt.so
SOURCES += $$PWD/src-opi5/*.c $$PWD/src-opi5/*.cpp $$PWD/src-opi5/*.cc
HEADERS += $$PWD/src-opi5/*.h
} else {
} else:opencv {
message("OpenCV build")
message("You must use YOLOv8 ONNX files. Azaion model does not work!")
message("OpenCV must be version 4.10.0 installed to /usr/local/")
QMAKE_CXXFLAGS += -DOPENCV_BUILD
QMAKE_LFLAGS += -Wl,-rpath,/usr/local/lib
SOURCES += $$PWD/src-opencv-onnx/*.cpp
HEADERS += $$PWD/src-opencv-onnx/*.h
}
else {
message("ONNX build")
message("You must use YOLOv8 ONNX files")
message("You must use YOLOv8 ONNX files. Azaion ONNX model also works fine.")
QMAKE_CXXFLAGS += -DONNX_BUILD
INCLUDEPATH += /opt/onnxruntime-linux-x64-1.18.0/include
LIBS += /opt/onnxruntime-linux-x64-1.18.0/lib/libonnxruntime.so.1.18.0
QMAKE_LFLAGS += -Wl,-rpath,/opt/onnxruntime-linux-x64-1.18.0/lib
QMAKE_LFLAGS += -Wl,-rpath,/usr/local/lib
SOURCES += $$PWD/src-opencv-onnx/*.cpp
HEADERS += $$PWD/src-opencv-onnx/*.h
SOURCES += $$PWD/src-onnx-runtime/*.cpp
HEADERS += $$PWD/src-onnx-runtime/*.h
}