mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 22:46:33 +00:00
d4779b1bb0
- added printing of inference FPS - simple AI test bench which can be used to compare models
32 lines
569 B
C++
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;
|
|
};
|
|
|