
人工智能
文章平均质量分 82
shuai_wen
这个作者很懒,什么都没留下…
展开
-
std::function
std::function - 碎语心弦 - 博客园参考资料• cplusplus.com:http://www.cplusplus.com/reference/functional/function/• cppreference.com:http:/https://www.cnblogs.com/heartchord/p/5017071.htmlC++ Tutorial - std::function: To wrap any element that is callableLearn C++ - s原创 2022-01-15 17:24:26 · 492 阅读 · 0 评论 -
TFLite JNI 接口实现
要实现Mace JNI 接口,先研究下TFLite的 JNI接口实现Java Code Examples for org.tensorflow.lite.TensorJava Code Examples for org.tensorflow.lite.Tensorhttps://www.programcreek.com/java-api-examples/?api=org.tensorflow.lite.Tensor学习 java-api的网址 如ByteBufferJava Code Exam原创 2022-01-05 14:10:12 · 1899 阅读 · 0 评论 -
MACE 使用笔记
环境安装tensorflow 安装,一直不太想要mace的部分原因是不支持tensorflow2.模型。Shellset -e学习笔记: shell 中的 set -e , set +e 用法_滴水成川-优快云博客_linux set-eset-eset命令的-e参数,linux自带的说明如下:"Exitimmediatelyifasimplecommandexitswithanon-zerostatus."也就是说,在"set-e"之后出现的代码,一旦出现了返回值...原创 2021-12-21 19:01:01 · 2084 阅读 · 0 评论 -
Android Bitmap, JNI 和 openCV
Camera Raw data YUV -> BitmapAndroid Bitmap像素排列与JNI操作android bitmap 到 jni的过程Android Bitmap像素排列与JNI操作 - 掘金RGB颜色模型即红绿蓝颜色模型。由模仿生物视网膜三种视锥细胞产生,之后通过三原色叠加来进行彩色图像显示。通过在黑色上不断叠加三原色来显示不同的颜色。在RGB颜色空间中,分别将RGB作为笛卡尔坐标系中XYZ坐标系产生。每一个颜色取值范围为[0,256) RGB是从颜色发光的原理来…原创 2021-12-07 20:18:03 · 572 阅读 · 0 评论 -
camera2 java 层框架分析和使用案例
android.hardware.camera2 提供了访问android device上camera devices的接口The android.hardware.camera2 package provides an interface toindividual camera devices connected to an Android device. It replacesthe deprecated {android.hardware.Camera}android.hardware.c原创 2021-12-01 17:44:00 · 3503 阅读 · 0 评论 -
camera: framework
Android Camera:Camera Framework架构_你好呀,信田君!-优快云博客_android camera frameworkCamera从上到下,主要分为三层:APP client 、CameraFramework、CameraHal。这三层分别运行在不同的进程,APP client运行在APP用户进程中,CameraFramework运行在cameraserver进程中,而CamerHal运行在provider进程中。原文链接:https://blog.youkuaiyun.com/biand原创 2021-12-01 14:27:24 · 361 阅读 · 0 评论 -
CV: camera数据预处理
Camera 常见的数据输出格式有:Rawdata 格式、YUV 格式、RGB 格式。RGB 格式:采用这种编码方法,每种颜色都可用三个变量来表示红色、绿色以及蓝色的强度。每一个像素有三原色 R 红色、G 绿色、B 蓝色组成。YUV 格式:其中“Y”表示明亮度(Luminance 或 Luma),就是灰阶值;而“U”和“V”表示色度(Chrominance 或 Chroma),是描述影像色彩及饱和度,用于指定像素的颜色。RAW DATA 格式:是 CCD 或 CMOS 在将光信号转换为电信号时的原创 2021-11-30 21:10:21 · 3282 阅读 · 0 评论 -
C++: reference
References in C++ - GeeksforGeeksA Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.https://www.原创 2021-11-28 12:05:47 · 244 阅读 · 0 评论 -
C++: 匿名 函数
mSensors->getSensorsList([&](const auto &list) {...});代码里出现 [], [&] 看不懂是什么意思?C++ lambda表达式与函数对象 - 简书C++ lambda表达式与函数对象 lambda表达式是C++11中引入的一项新技术,利用lambda表达式可以编写内嵌的匿名函数,用以替换独立函数或者函数对象,并且使代码...https://www.jianshu.com/p/d686ad9de817这篇文章讲的很清楚原创 2021-11-28 12:01:36 · 397 阅读 · 0 评论 -
C++: STL
The C++ Standard Template Library (STL) - GeeksforGeeksThe Standard Template Library (STL) is a set of C++ template classes to provide common programming data structures and functions such as lists, stacks, arrahttps://www.geeksforgeeks.org/the-c-standard-原创 2021-11-26 16:46:18 · 1878 阅读 · 0 评论 -
C++: Array and String
什么是arrayArrays in C/C++ - GeeksforGeeksA Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.http原创 2021-11-26 11:47:42 · 691 阅读 · 0 评论 -
Templates in C++
Templates in C++ - GeeksforGeekshttps://www.geeksforgeeks.org/templates-cpp/What is templateA template is a simple and yet very powerful tool in C++. The simple idea is to pass data type as a parameter so that we don’t need to write the same code for d原创 2021-11-24 14:18:46 · 718 阅读 · 0 评论 -
Resource acquisition is initialization (RAII)
Resource acquisition is initialization(RAII) is aprogramming idiom used in severalobject-oriented,statically-typedprogramming languages to describe a particular language behavior. (C 语言没有构造析构函数,就不能直接用RAII)In RAII, holding a resource is aclass invar...原创 2021-11-23 15:25:07 · 627 阅读 · 0 评论 -
C++ smart pointer
smart pointer是什么In computer science, a smart pointer is an abstract data type that simulates a pointer while providing added features, such as automatic memory management or bounds checking.是个抽象的数据类型,模拟指针的行为同时提供附加的features: 比如自动memory管理或边界检查Such fea原创 2021-11-22 18:45:17 · 932 阅读 · 0 评论 -
libc and libc++
C 的标准库函数有哪些?C++的标准库函数有哪些?Coding时要尽量使用之,要注意哪些问题?C standard libraryTheC standard libraryorlibcis thestandard libraryfor theC programming language, as specified in theISO Cstandard.[1]Starting from the originalANSI Cstandard, it was developed ...原创 2021-11-22 14:14:38 · 2068 阅读 · 0 评论 -
JNI怎样访问Asset 目录下文件
问题诉求:native 库函数的输入参数是个文件的路径,如果把文件放到APK的 asset路径下,该怎样得到?Asset 不是普通的文件,是打包、压缩到APK的There is no "absolute path for a file existing in the asset folder". The content of your project'sassets/folder are packaged in the APK file. Use anAssetManagerobje...原创 2021-11-12 10:10:14 · 2647 阅读 · 0 评论 -
怎样使用OpenCV
1. 怎样编译 openCV如果要使用opencv开发,必须下载源代码然后编译https://linuxize.com/post/how-to-install-opencv-on-ubuntu-20-04/https://linuxize.com/post/how-to-install-opencv-on-ubuntu-20-04/在opencv 目录下创建 build 文件夹然后执行cmake commandSet up the OpenCV build with CMake:cma原创 2021-11-10 14:10:21 · 5674 阅读 · 0 评论 -
AI reference 优化
深度学习推理性能优化 - 姚伟峰 - 博客园深度学习推理性能优化 推理性能优化: 一个越来越重要的话题 一些初期的探索和经验 推理优化四部曲 算子优化 图优化 模型压缩 部署优化 前方的路 References 推理性能优化: 一个越来越重要的https://www.cnblogs.com/Matrix_Yao/p/13181778.html...原创 2021-11-03 13:40:28 · 382 阅读 · 0 评论 -
NCHW 与 NHWC 的区别
图像数据格式定义了一批图片数据的存储顺序。在调用 TensorFlow API 时会经常看到 data_format 参数:data_format 默认值为 "NHWC",也可以手动设置为 "NCHW"。这个参数规定了 input Tensor 和 output Tensor 的排列方式。data_format 设置为 "NHWC" 时,排列顺序为 [batch, height, width, channels];设置为 "NCHW" 时,排列顺序为 [batch, channels,原创 2021-11-03 11:40:29 · 2563 阅读 · 0 评论 -
微信二维码
微信二维码简介微信二维码引擎OpenCV开源!3行代码让你拥有微信扫码能力 - 知乎zxing 代码分析掘金ZXing源码解析四:如何识别图片中的二维码https://github.com/jenly1314/WeChatQRCodeWechar移植https://github.com/jenly1314/WeChatQRCode...原创 2021-11-02 11:47:40 · 1878 阅读 · 0 评论 -
OpenCL/OpenGL ES
OpenCL并行编程 - 简书OpenCL:一种异构计算架构 - Let it be! - 博客园OpenCL之矩阵乘法实现_I AM BACK-优快云博客GPGPU OpenCL编程步骤与简单实例 - 旭东的博客 - 博客园OpenCL之矩阵乘法实现_I AM BACK-优快云博客OpenCL/OpenGL/DirectX/CUDA - 作业部落 Cmd Markdown 编辑阅读器opengl(opengl)和开放计算语言(opencl)的区别 - tl80互动问答网82 bes原创 2021-11-01 15:26:54 · 291 阅读 · 0 评论 -
TensorFlow Lite for Microcontrollers 的依赖和相关的macro
如果要移植tflm代码到一个单独工程上去编译,要主要这些依赖库,因为这些库是动态下载的,执行某些脚本才有对应的文件,要特别注意-I./third_party/gemmlowp \-I./third_party/flatbuffers/include \-I./third_party/ruyflatbuffer(tflite model)**FlatBuffers** is a cross platform serialization library architected forma..原创 2021-10-29 17:22:29 · 948 阅读 · 0 评论 -
TensorFlow Lite for Microcontrollers 的使用和实现
使用方法参考tensorflow/lite/micro/examples/xxx 目录下的使用方法, 以hello_world为例,文件hello_world_test.cc1. 创建MicroErrorReporter objecttflite::MicroErrorReporter micro_error_reporter;2. 有tflite model文件得到 tflite::Modle 结构体const tflite::Model* model = ::tflite::G.原创 2021-10-27 19:00:44 · 3996 阅读 · 0 评论 -
TFLM: 内存分配
GreedyMemoryPlannerGreedyMemoryPlanner是管理内存布局的,在推理过程中前面算子占用的内存,当运行到后面的算子时这些资源是可以释放的,GreedyMemoryPlanner也是用于解决这个问题的。GreedyMemoryPlanner本身不分配内存,只是得到Planner的策略,有那些内存可以复用。在不同的时间点上,某个client 占用的资源,在这个时间轴上只有某个时间段使用,如果整个生命周期已知占用,就有浪费。构造函数:GreedyMemoryPlanner原创 2021-10-22 19:48:08 · 911 阅读 · 0 评论 -
怎样搭建网络
相关基类https://www.tensorflow.org/api_docs/python/tf/keras/tf.keras下的类之间的关系tf.Moduletf.keras.layers.Layertf.keras.Inputtf.keras.Modeltf.keras.Model和tf.keras.Sequential都是创建Model的方法Model的核心方法: compile, fit, evaluate, predict等c...原创 2021-10-15 15:50:41 · 517 阅读 · 0 评论 -
怎样降低误识别率
解决样本不均衡的问题-调整类权重 修改交叉熵loss_notHeadache的博客-优快云博客_交叉熵训练样本不均衡解决样本不均衡的问题-调整类权重 修改交叉熵python - How to define a weighted loss function for TF2.0+ keras CNN for image classification? - Stack Overflow【keras】实现加权交叉熵(多分类)_GXLiu-优快云博客_加权交叉熵...原创 2021-09-29 15:18:48 · 249 阅读 · 0 评论 -
Mace micro的使用
TFLite/ micro的使用方法:对模型文件的处理:直接转换成 unsigned char [] 如:xxd -i weights.hdf5 test.c直接转换没有任何协议和格式对接口的使用---Mace/ micro的使用方法习惯了TLite对模型的使用,在使用mace感觉不那么直接1. 需要一个描述model的 yml协议的配置文件 这个文件描述 model的格式是 h5 , pb等 model 要运作在什么平台上: CPU/ GP...原创 2021-09-16 15:22:52 · 396 阅读 · 0 评论 -
Java List
1. 包含源文件、头文件、生成静态库/动态库,依赖动态库静态库、交叉编译(编译参数的设置), 宏定义2. 测试用例基本操作CMakeLists.txt 一般和源文件在同级目录, 在 CMakeList.txt 目录下创建文件夹 build, 在 build目录下执行 cmake .., 然后执行make, 生成的结果都在build目录下。 add_library(macemc_skel SHARED macemc/rpc/skel/macemc.cc macemc/r...原创 2021-06-24 16:31:02 · 131 阅读 · 0 评论 -
reflection
https://docs.oracle.com/javase/tutorial/reflect/index.html原创 2021-06-11 12:15:29 · 188 阅读 · 0 评论 -
runnable, thread, handler
runnalbe 是个啥?package java.lang;@FunctionalInterfacepublic interface Runnable { void run();}只是一个interface而已class RecordThread implements Runnable {public void startRecording() { // getMinBufferSize is a class static method audioBuf原创 2021-05-23 23:16:57 · 163 阅读 · 0 评论 -
PCM双声道分离为单声道
双声道的数据存储格式https://blog.youkuaiyun.com/chinabinlang/article/details/72932947有两种类型, LRLR...每个采样点交替, LLL...RRR 每个通道隔离C++的实现;为了简单,我这里先知实现一个声道的获取:unsigned char * get_oneChannel_left_from_doubleChannel(unsigned char * pDoubleChannelBuf, int nLen, int nPerSam原创 2021-05-22 22:44:28 · 950 阅读 · 1 评论 -
怎样收集唤醒词数据和得到期望的数据:Loudest Section
问题:怎样录音https://github.com/tinyMLx/open-speech-recordinghttps://github.com/petewarden/open-speech-recording问题: 如果录音3秒钟,而其中说话的部分只有约1秒钟,其他是背景音,怎样找到说话的那一秒钟对应的数据?Speech Commands: A Dataset for Limited-Vocabulary Speech Recognitionhttps://arxiv.org/pdf原创 2021-04-14 10:09:52 · 380 阅读 · 0 评论 -
wave格式分析
1. 怎样用VIM 16进制打开:%!xxd:%!xxd -r2. wav文件格式在文件的前44字节放置标头(header),使播放器或编辑器能够简单掌握文件的基本信息,其内容以区块(chunk)为最小单位,每一区块长度为4字节通过一个具体的文件对应看下音讯格式:小端(低地址对应低位) 0100 -> 0001 (PCM)通道数: 小端0100 -> 0001 (单通道)采样率: 小端 803e 0000 -> 00003e80 (1600...原创 2021-04-13 17:35:07 · 412 阅读 · 0 评论 -
tflite interpreter
https://www.tensorflow.org/lite/guide/inference怎样训练模型后进行推断验证假设输入数据为list, 假设为yes_listimport numpy as npimport tensorflow as tf# Load the TFLite model and allocate tensors.interpreter = tf.lite.Interpreter(model_path="converted_model.tflite")in.原创 2021-03-05 09:43:50 · 1532 阅读 · 3 评论 -
CMake的使用
基本功能:怎样使用:在CMakeLists.txt的目录下创建build文件夹,在build 路径 执行cmake .. (.. 表示上级目录), 然后执行make, 生成的中间文件 和 target文件都在build路径下。怎样定义target:可执行文件、静态库和动态库add_library(hello_library STATIC /SHARED (默认是static) src/Hello.cpp)add_executable(hello_binary sr...原创 2021-03-04 09:31:41 · 558 阅读 · 1 评论 -
MFCC 学习
Mel Frequency Cepstral Coefficient (MFCC) tutorialhttp://www.practicalcryptography.com/miscellaneous/machine-learning/guide-mel-frequency-cepstral-coefficients-mfccs/这篇英文文章讲的的挺好,还有对应的代码https://github.com/jameslyons/python_speech_featureshttps://en.原创 2021-03-02 17:26:38 · 383 阅读 · 0 评论 -
jni with gradle
相关学习资料https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/jniTOC.htmlhttps://www.baeldung.com/jnihttps://www.protechtraining.com/bookshelf/java_fundamentals_tutorial/_java_native_interface_jnihttps://wwmmyy.github.io/2017/09/21/Android%原创 2021-02-20 17:25:24 · 301 阅读 · 1 评论 -
google speech command dataset的生成
生成数据集的代码tensorflow/examples/speech_commands➜ speech_commands git:(master) ✗ lsaccuracy_utils.cc data input_data.py label_wav_test.py recognize_commands.h train.pyaccuracy_utils.h free...原创 2021-02-09 16:58:58 · 3055 阅读 · 0 评论 -
tflite micro makefile and test
Makefile原创 2021-01-29 17:51:19 · 651 阅读 · 1 评论 -
模型量化整理
https://tensorflow.google.cn/model_optimization/guide/原创 2021-01-29 16:16:40 · 226 阅读 · 0 评论