ncnn-blob.h

网络中输入-输出对应标记(网络层中的节点名??)。

class NCNN_EXPORT Blob
{
public:// emptyBlob();public:
#if NCNN_STRING// blob namestd::string name;
#endif // NCNN_STRING// layer index which produce this blob as outputint producer;// layer index which need this blob as inputint consumer;// shape hintMat shape;
};

cpp

Blob::Blob()
{producer = -1;consumer = -1;
}

ncnn-datareader.h

文件读取


// data read wrapper
class NCNN_EXPORT DataReader
{
public:DataReader();virtual ~DataReader();#if NCNN_STRING// parse plain param text// return 1 if scan success//解析模型文件 ,成功返回1virtual int scan(const char* format, void* p) const;
#endif // NCNN_STRING// read binary param and model data// return bytes read//读取二进制模型数据 返回字节数virtual size_t read(void* buf, size_t size) const;// get model data reference// return bytes referencedvirtual size_t reference(size_t size, const void** buf) const;
};

ncnn-net.h

提取

class ExtractorPrivate;
class NCNN_EXPORT Extractor
{
public:virtual ~Extractor();// copyExtractor(const Extractor&);// assignExtractor& operator=(const Extractor&);// clear blob mats and alloctorsvoid clear();// enable light mode// intermediate blob will be recycled when enabled// enabled by defaultvoid set_light_mode(bool enable);// set thread count for this extractor// this will overwrite the global setting// default count is system dependedvoid set_num_threads(int num_threads);// set blob memory allocatorvoid set_blob_allocator(Allocator* allocator);// set workspace memory allocatorvoid set_workspace_allocator(Allocator* allocator);#if NCNN_VULKANvoid set_vulkan_compute(bool enable);void set_blob_vkallocator(VkAllocator* allocator);void set_workspace_vkallocator(VkAllocator* allocator);void set_staging_vkallocator(VkAllocator* allocator);
#endif // NCNN_VULKAN#if NCNN_STRING// set input by blob name// return 0 if successint input(const char* blob_name, const Mat& in);// get result by blob name// return 0 if success// type = 0, default// type = 1, do not convert fp16/bf16 or / and packingint extract(const char* blob_name, Mat& feat, int type = 0);
#endif // NCNN_STRING// set input by blob index// return 0 if successint input(int blob_index, const Mat& in);// get result by blob index// return 0 if success// type = 0, default// type = 1, do not convert fp16/bf16 or / and packingint extract(int blob_index, Mat& feat, int type = 0);#if NCNN_VULKAN
#if NCNN_STRING// set input by blob name// return 0 if successint input(const char* blob_name, const VkMat& in);// get result by blob name// return 0 if successint extract(const char* blob_name, VkMat& feat, VkCompute& cmd);// set input by blob name// return 0 if successint input(const char* blob_name, const VkImageMat& in);// get result by blob name// return 0 if successint extract(const char* blob_name, VkImageMat& feat, VkCompute& cmd);
#endif // NCNN_STRING// set input by blob index// return 0 if successint input(int blob_index, const VkMat& in);// get result by blob index// return 0 if successint extract(int blob_index, VkMat& feat, VkCompute& cmd);// set input by blob index// return 0 if successint input(int blob_index, const VkImageMat& in);// get result by blob index// return 0 if successint extract(int blob_index, VkImageMat& feat, VkCompute& cmd);
#endif // NCNN_VULKANprotected:friend Extractor Net::create_extractor() const;Extractor(const Net* net, size_t blob_count);private:ExtractorPrivate* const d;
};
//通过输入名获得对应的输入索引
int Extractor::input(const char* blob_name, const VkImageMat& in)
{int blob_index = d->net->find_blob_index_by_name(blob_name);if (blob_index == -1){NCNN_LOGE("Try");const std::vector<const char*>& input_names = d->net->input_names();for (size_t i = 0; i < input_names.size(); i++){NCNN_LOGE("    ex.input(\"%s\", in%d);", input_names[i], (int)i);}return -1;}return input(blob_index, in);
}//通过输入索引获得结果值
int Extractor::input(int blob_index, const Mat& in)
{if (blob_index < 0 || blob_index >= (int)d->blob_mats.size())return -1;d->blob_mats[blob_index] = in;return 0;
}

ncnn DataReaderExtractorblob相关推荐

  1. GitHub开源:17M超轻量级中文OCR模型、支持NCNN推理

    目录 1.项目简介 2.项目配置 3.问题解决 1.项目简介 近期GitHub上一位大神开源了一个叫做chineseocr_lite的OCR的项目,这是一个超轻量级中文OCR,支持竖排文字识别.NCN ...

  2. Ubuntu18.04 编译 ncnn

    官方文档(https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-linux-x86)上说的是: install g++ cmake p ...

  3. 重构ncnn,腾讯优图开源新一代移动端推理框架TNN

    来源 | 腾讯优图 从学界到工业界,"开源"已经成为AI领域的一个关键词.一方面,它以"授人以渔"的方式为AI构建了一个开放共进的生态环境,帮助行业加速AI应用 ...

  4. 超轻量级中文OCR,支持竖排文字识别、ncnn推理,总模型仅17M

    整理 | AI科技大本营 光学字符识别(OCR)技术已经得到了广泛应用.比如发票上用来识别关键字样,搜题App用来识别书本上的试题. 近期,这个叫做chineseocr_lite的OCR项目开源了,这 ...

  5. 实践教程|YOLOX目标检测ncnn实现

    作者 | 唐超@知乎(已授权) 来源丨https://zhuanlan.zhihu.com/p/391788686 编辑丨极市平台 导读 本文将YOLOX训练的模型转到ncnn进行推理加速. YOLO ...

  6. 实操教程|详细记录solov2的ncnn实现和优化

    作者丨欧阳慧宇@知乎(已授权) 来源丨https://zhuanlan.zhihu.com/p/361900997 编辑丨极市平台 极市导读 由于目前solo系列在GitHub中没有转ncnn的项目, ...

  7. Github标星3K+,超轻量级中文OCR,支持竖排文字识别、ncnn推理,总模型仅17M

    关注上方"深度学习技术前沿",选择"星标公众号", 资源干货,第一时间送达! 光学字符识别(OCR)技术已经得到了广泛应用.比如发票上用来识别关键字样,搜题Ap ...

  8. 深度学习框架大PK:TNN决战MNN,ncnn依旧经典

    近年来,开发者社区中,「开源」成了新流行趋势. 尤其是深度学习框架,自腾讯2017年将ncnn开源之后,各大AI实验室都「慷慨」的将自己的框架开源,以实现较为快速的创新. 今年6月10日,腾讯又宣布基 ...

  9. yolov5 ncnn

    c++ input_size要设置为640,即onnx导出模型输入是320, 如果onnx输入改为640,Android执行会死机. 原版是394,375,output,3.0输出是: 394,374 ...

  10. ncnn tensorrt

    ncnn: 已实现 winograd 卷积加速,int8 压缩和推断,还有基于 vulkan 的 gpu 推断 同时也支持将Caffe模型转化为int8精度. 而ONNX模型的转化则是近半年来的实现成 ...

最新文章

  1. error: ‘__declspec‘ attributes are not enabled; use ‘-fdeclspec‘ or ‘-fms-extensions‘ to enabl
  2. TestInside640-801 v11(神州testv11)题库视频讲解(全部上传完毕)
  3. mysql5.7.32 win7_拯救10年前老爷机:C盘不到3G的Win7官方精简版amp;俄大神精简版分享...
  4. centos7.3部署kvm虚拟化
  5. python画图表的库_「Python」python绘制图表
  6. matlab波形振幅,MATLAB正交振幅调制解调仿真分析(一)
  7. SPField的几种name的释疑
  8. Pygame 整活五子棋
  9. 通过Rancher部署并扩容Kubernetes集群基础篇一
  10. 2018杭州电子科技大学计算机研究生复试笔试编程题第三题
  11. nginx配置文件简单理解(自用)
  12. CSS伪类的又一个小应用,实现下拉菜单
  13. 永磁同步电机矢量控制(四)——simulink仿真搭建
  14. 异步社区两周年 - 技术图书免费送(活动已结束)
  15. python爬取酷狗音乐歌词_Python爬虫:爬取酷狗音乐
  16. 传智播客到底在坚持什么?
  17. 某头条安卓逆向学习----改机/逆向/Hook/协议
  18. 电子设计教程48:流水灯电路-完整电路设计
  19. java版我的世界光追,光追有多神奇?我的世界VS别人的世界
  20. 00007__文本编辑器__UltraEdit

热门文章

  1. 整体大于部分_康托尔集合论:无穷集合中,整体不一定大于部分
  2. 康托尔、哥德尔、图灵——永恒的金色对角线(rev#2)
  3. centos yum 第三方仓库 scl 应用
  4. 利用Hexo GitHub Page和 travis CI搭建播客
  5. 基于R16标准的5G电力高精度授时解决方案PTP授时方案
  6. jquery 的税收计算器(仅限参考)
  7. 单引号在c语言中作用,我想知道单引号在C语言的具体作用
  8. 会写SQL==精通MYSQL?NONONO,进来学习一下吧! 0.0
  9. 【科研人应该知道的网站】查阅文献+学习+代码+开发+其他——研究生必备学习网站,研究生应该知道的学习网站
  10. 魔兽怀旧玩家显示服务器名称插件,新手必看:非插件相关的魔兽怀旧服常用系统设置...