赞
踩
ACLLite库是对CANN提供的ACL接口进行的高阶封装,简化用户调用流程,为用户提供一组简易的公共接口。当前主要针对边缘场景设计。
AclLiteResource类:命名空间为acllite
AclLiteResource(int32_t devId = 0)
~AclLiteResource()
bool Init()
aclrtContext GetContext()
void Release()
未封装为类:命名空间为acllite
void SaveBinFile(const std::string& filename, const void* data, uint32_t size)
bool ReadBinFile(const std::string& fileName, void*& data, uint32_t& size)
void* CopyDataToDevice(void* data, uint32_t size)
aclrtContext GetContextByDevice(int32_t devId)
bool SetCurContext(aclrtContext context)
宏封装函数:无命名空间
ALIGN_UP(num, align)
ALIGN_UP2(num, align)
ALIGN_UP16(num, align)
ALIGN_UP64(num, align)
ALIGN_UP128(num, align)
YUV420SP_SIZE(width, height)
YUV422P_SIZE(width, height)
SHARED_PTR_U8_BUF(buf)
SHARED_PTR_HOST_BUF(buf)
SHARED_PTR_DEV_BUF(buf)
SHARED_PTR_DVPP_BUF(buf)
CHECK_RET(cond, return_expr)
LOG_PRINT(message, …)
全局变量:命名空间为acllite
Result
RES_OK
RES_ERROR
数据结构:命名空间为acllite
struct DataInfo
struct InferenceOutput
struct ImageSize
struct ImageData
struct FrameData
enum memoryLocation
enum ResizeType
enum StreamProperty
struct DvRect
VideoRead类:命名空间为acllite
VideoRead(const std::string& videoName, int32_t deviceId = 0, aclrtContext context = nullptr)
~VideoRead()
bool Read(ImageData& image)
bool IsOpened()
bool Set(StreamProperty propId, int value)
uint32_t Get(StreamProperty propId)
void Release()
VideoWrite类:命名空间为acllite
VideoWrite(std::string outFile, uint32_t maxWidth, uint32_t maxHeight, int32_t deviceId = 0)
~VideoWrite()
bool Write(ImageData& image)
bool IsOpened()
void Release()
ImageProc类:命名空间为acllite
ImageProc(int deviceId = 0)
~ImageProc()
ImageData Read(const std::string& fileName, acldvppPixelFormat imgFormat = PIXEL_FORMAT_YUV_SEMIPLANAR_420)
void Resize(ImageData& src, ImageData& dst, ImageSize dsize, ResizeType type = RESIZE_COMMON)
bool Write(const std::string& fileName, ImageData& img)
void Crop(ImageData& src, ImageData& dst, DvRect dRect, ImageSize dSize)
ModelProc类:命名空间为acllite
ModelProc()
~ModelProc()
void DestroyResource()
bool Load(const std::string& modelPath)
bool CreateInput(void *input, uint32_t size)
bool CreateInput(void *input1, uint32_t input1size, void *input2, uint32_t input2size)
bool CreateInput(std::vector& inputData)
bool Execute(std::vector& inferOutputs)
void DestroyInput()
void DestroyOutput()
void Unload()
CameraRead类:命名空间为acllite
CameraRead(const std::string& videoName, int32_t deviceId = 0, aclrtContext context = nullptr)
~CameraRead()
bool Read(ImageData& image)
bool IsOpened()
void Release()
uint32_t Get(StreamProperty propId)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。