tensorflow android 关键词 激活
来源:互联网 发布:淘宝上怎么添加旺旺 编辑:程序博客网 时间:2024/05/22 17:04
工程源码在
代码我已托管到github上了。里面有一个已经编译好的apk,
adb install 后就可以实际使用了。
https://github.com/shichaog/tensorflow-android-speech-kws
基于官网。
Android tensorflow API
private static final String LABEL_FILENAME = "file:///android_asset/conv_actions_house_labels.txt"; private static final String MODEL_FILENAME = "file:///android_asset/my_house_frozen_graph.pb"; private TensorFlowInferenceInterface inferenceInterface; // Load the TensorFlow model. inferenceInterface = new TensorFlowInferenceInterface(getAssets(), MODEL_FILENAME); // Run the model. inferenceInterface.feed(SAMPLE_RATE_NAME, sampleRateList); inferenceInterface.feed(INPUT_DATA_NAME, floatInputBuffer, RECORDING_LENGTH, 1); inferenceInterface.run(outputScoresNames); inferenceInterface.fetch(OUTPUT_SCORES_NAME, outputScores);
以上就是android 的API,和python的流程基本一直。
创建这个流程图就是在创建计算图,并且加载模型参数。
public TensorFlowInferenceInterface(AssetManager var1, String var2) { this.prepareNativeRuntime(); this.modelName = var2; this.g = new Graph(); this.sess = new Session(this.g); this.runner = this.sess.runner(); boolean var3 = var2.startsWith("file:///android_asset/"); Object var4 = null; try { String var5 = var3?var2.split("file:///android_asset/")[1]:var2; var4 = var1.open(var5); } catch (IOException var9) { if(var3) { throw new RuntimeException("Failed to load model from \'" + var2 + "\'", var9); } try { var4 = new FileInputStream(var2); } catch (IOException var8) { throw new RuntimeException("Failed to load model from \'" + var2 + "\'", var9); } } try { this.loadGraph((InputStream)var4, this.g); ((InputStream)var4).close(); Log.i("TensorFlowInferenceInterface", "Successfully loaded model from \'" + var2 + "\'"); } catch (IOException var7) { throw new RuntimeException("Failed to load model from \'" + var2 + "\'", var7); } }
阅读全文
0 0
- tensorflow android 关键词 激活
- tensorflow中的激活函数
- android 关键词
- tensorflow: 激活函数(Activation_Functions) 探究
- Tensorflow ActiveFunction激活函数解析
- tensorflow:激活函数(Activation Function)
- 8、TensorFlow 中的激活函数
- tensorflow学习笔记(四):激活函数
- 简化激活Tensorflow环境的方法
- tensorflow激活函数relu()的详解
- Tensorflow深度学习之五:激活函数
- tensorflow-激活函数及tf.nn.dropout
- Tensorflow深度学习之五:激活函数
- 【Tensorflow】Anaconda中激活tensorflow后如何使用
- 记录android几个关键词
- android 4.3关键词
- tensorflow android
- Android激活管理员权限
- 双线性插值原理及其实现--基于OpenCV实现
- Makefile---简介
- 数据库分区表
- leetcode 3.Longest Substring Without Repeating Characters
- 短信监听器
- tensorflow android 关键词 激活
- 基础图形绘制
- [Python] Mac OS 下 os.startfile 的替代方案
- 【安卓学习笔记】JAVA基础Lesson8-函数的复写与super用法
- django rest framework使用django-filter
- 图解电容充放电
- 当前时代信息收集技巧初步总结
- 移动端 滑屏
- 两小时一个Java小项目---TelBook