48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
#ifndef _YOLOV5_DETECT_H_
|
|
#define _YOLOV5_DETECT_H_
|
|
|
|
#include "yolov5_detect_postprocess.h"
|
|
#include "rknn_api.h"
|
|
#include <opencv2/opencv.hpp>
|
|
|
|
|
|
// 标准库中的base64编码器
|
|
static const std::string base64_chars =
|
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
|
"abcdefghijklmnopqrstuvwxyz"
|
|
"0123456789+/";
|
|
|
|
std::string base64_encode(unsigned char const* bytes_to_encode, unsigned int in_len);
|
|
|
|
static inline bool is_base64(unsigned char c) ;
|
|
|
|
|
|
|
|
/*
|
|
* yolov5检测初始化函数
|
|
* ctx:输入参数,rknn_context句柄
|
|
* path:输入参数,算法模型路径
|
|
*/
|
|
int yolov5_detect_init(rknn_context *ctx, const char * path);
|
|
|
|
|
|
/*
|
|
* yolov5检测执行函数
|
|
* ctx:输入参数,rknn_context句柄
|
|
* input_image:输入参数,图像数据输入(cv::Mat是Opencv的类型)
|
|
* output_dets:输出参数,目标检测框输出
|
|
*/
|
|
int yolov5_detect_run(rknn_context ctx, cv::Mat input_image, yolov5_detect_result_group_t *detect_result_group);
|
|
|
|
|
|
/*
|
|
* yolov5检测释放函数
|
|
* ctx:输入参数,rknn_context句柄
|
|
*/
|
|
int yolov5_detect_release(rknn_context ctx);
|
|
|
|
|
|
|
|
|
|
#endif
|