You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.5 KiB
51 lines
1.5 KiB
#ifndef VIDEO_TO_AI_HPP |
|
#define VIDEO_TO_AI_HPP |
|
#define NOMINMAX |
|
#include "hailo/hailort.hpp" |
|
#include "hailo/vdevice.hpp" |
|
#include "hailo/expected.hpp" |
|
#include "hailo/hailort_common.hpp" |
|
#include "hailo/runtime_statistics.hpp" |
|
#include <iostream> |
|
#include <chrono> |
|
#include <thread> |
|
#include <fstream> |
|
|
|
#include <cstring> |
|
#if defined(__unix__) |
|
#include <sys/mman.h> |
|
#endif |
|
//#include <include/common.h> |
|
#include <opencv2/opencv.hpp> |
|
#include <vector> |
|
#include <mutex> |
|
#include <condition_variable> |
|
#include <queue> |
|
|
|
namespace VideoToAI |
|
{ |
|
using hailort::ConfiguredInferModel; |
|
using hailort::InferModel; |
|
using hailort::VDevice; |
|
using hailort::hailort_error; |
|
using hailort::AsyncInferCompletionInfo; |
|
using hailort::DmaMappedBuffer; |
|
using hailort::MemoryView; |
|
struct DetectionResult { |
|
hailo_bbox_float32_t bbox; |
|
int class_id; |
|
float confidence; |
|
}; |
|
std::shared_ptr<uint8_t> page_aligned_alloc(size_t size); |
|
std::string get_coco_name_from_int(int cls); |
|
|
|
void letterbox(const cv::Mat& image, cv::Mat& outImage, |
|
const cv::Size& newShape = cv::Size(640, 640), |
|
const cv::Scalar& color = cv::Scalar(128, 128, 128), |
|
bool scaleUp = true); |
|
|
|
void hailoInference(cv::Mat& yPlane, cv::Mat& uvPlane, ConfiguredInferModel& configured_infer_model, std::shared_ptr<InferModel>& infer_model, VDevice* vdevice, std::vector<DetectionResult>& detection_results); |
|
|
|
} |
|
|
|
#endif // VIDEO_TO_AI_HPP
|