Files
autopilot/misc/rtsp_ai_player/src-ncnn/aiengineinferencencnn.h
T
Tuomas Järvinen d4779b1bb0 - addedd NCNN model support to rtsp_ai_player
- added printing of inference FPS
- simple AI test bench which can be used to compare models
2024-10-02 19:15:49 +02:00

32 lines
569 B
C++

#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;
};