mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 12:56:33 +00:00
Fully working OPI5 and Azaion AI object recognition
This commit is contained in:
@@ -2,8 +2,12 @@
|
||||
#include <opencv2/highgui.hpp>
|
||||
#include "aiengine.h"
|
||||
#include "aiengineinference.h"
|
||||
#include "src-onnx/aiengineinferenceonnx.h"
|
||||
|
||||
#ifdef OPI5_BUILD
|
||||
#include "src-opi5/aiengineinferenceopi5.h"
|
||||
#else
|
||||
#include "src-onnx/aiengineinferenceonnx.h"
|
||||
#endif
|
||||
|
||||
AiEngine::AiEngine(QString modelPath, QObject *parent)
|
||||
: QObject{parent}
|
||||
@@ -11,8 +15,13 @@ AiEngine::AiEngine(QString modelPath, QObject *parent)
|
||||
mRtspListener = new AiEngineRtspListener(this);
|
||||
connect(mRtspListener, &AiEngineRtspListener::frameReceived, this, &AiEngine::frameReceivedSlot);
|
||||
|
||||
#ifdef OPI5_BUILD
|
||||
mInference = new AiEngineInferenceOpi5(modelPath);
|
||||
#else
|
||||
mInference = new AiEngineInferenceOnnx(modelPath);
|
||||
#endif
|
||||
|
||||
QThread *inferenceThread = new QThread(this);
|
||||
mInference = new AiEngineInferenceOnnx(modelPath);
|
||||
mInference->moveToThread(inferenceThread);
|
||||
connect(mInference, &AiEngineInference::resultsReady, this, &AiEngine::inferenceResultsReceivedSlot, Qt::QueuedConnection);
|
||||
connect(this, &AiEngine::inferenceFrame, mInference, &AiEngineInference::performInferenceSlot, Qt::QueuedConnection);
|
||||
@@ -36,7 +45,12 @@ void AiEngine::inferenceResultsReceivedSlot(AiEngineInferenceResult results)
|
||||
{
|
||||
(void)results;
|
||||
qDebug() << "AiEngine got inference results in thread: " << QThread::currentThreadId();
|
||||
|
||||
cv::imshow("Received Frame", results.frame);
|
||||
|
||||
//#ifndef OPI5_BUILD
|
||||
//cv::imshow("Received Frame", results.frame);
|
||||
//#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user