- addedd NCNN model support to rtsp_ai_player

- added printing of inference FPS
- simple AI test bench which can be used to compare models
This commit is contained in:
Tuomas Järvinen
2024-10-02 19:15:49 +02:00
parent ef137fbc4b
commit d4779b1bb0
12 changed files with 555 additions and 763 deletions
@@ -0,0 +1,31 @@
#pragma once
#include <QObject>
#include <opencv2/core.hpp>
#include <ncnn/net.h>
#include "aiengineinference.h"
struct Object
{
cv::Rect_<float> rect;
int label;
float prob;
};
class AiEngineInferencevNcnn : public AiEngineInference
{
Q_OBJECT
public:
explicit AiEngineInferencevNcnn(QString modelPath, QObject *parent = nullptr);
void initialize(int number);
public slots:
void performInferenceSlot(cv::Mat frame) override;
private:
int detect_yolov8(const cv::Mat& bgr, std::vector<Object>& objects);
ncnn::Net yolov8;
};