-
大小: 65KB文件类型: .rar金币: 1下载: 0 次发布日期: 2021-05-13
- 语言: 其他
- 标签: tensorflow 语音识别
资源简介
完整的tensorflow语音识别代码,亲测可用,从训练到识别
代码片段和文件信息
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License Version 2.0 (the “License“);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing software
# distributed under the License is distributed on an “AS IS“ BASIS
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
r“““Converts a trained checkpoint into a frozen model for mobile inference.
Once you‘ve trained a model using the ‘train.py‘ script you can use this tool
to convert it into a binary GraphDef file that can be loaded into the Android
iOS or Raspberry Pi example code. Here‘s an example of how to run it:
bazel run tensorflow/examples/speech_commands/freeze -- \
--sample_rate=16000 --dct_coefficient_count=40 --window_size_ms=20 \
--window_stride_ms=10 --clip_duration_ms=1000 \
--model_architecture=conv \
--start_checkpoint=/tmp/speech_commands_train/conv.ckpt-1300 \
--output_file=/tmp/my_frozen_graph.pb
One thing to watch out for is that you need to pass in the same arguments for
‘sample_rate‘ and other command line variables here as you did for the training
script.
The resulting graph has an input for WAV-encoded data named ‘wav_data‘ one for
raw PCM data (as floats in the range -1.0 to 1.0) called ‘decoded_sample_data‘
and the output is called ‘labels_softmax‘.
“““
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os.path
import sys
import tensorflow as tf
from tensorflow.contrib.framework.python.ops import audio_ops as contrib_audio
import input_data
import models
from tensorflow.python.framework import graph_util
FLAGS = None
def create_inference_graph(wanted_words sample_rate clip_duration_ms
clip_stride_ms window_size_ms window_stride_ms
dct_coefficient_count model_architecture):
“““Creates an audio model with the nodes needed for inference.
Uses the supplied arguments to create a model and inserts the input and
output nodes that are needed to use the graph for inference.
Args:
wanted_words: Comma-separated list of the words we‘re trying to recognize.
sample_rate: How many samples per second are in the input audio files.
clip_duration_ms: How many samples to analyze for the audio pattern.
clip_stride_ms: How often to run recognition. Useful for models with cache.
window_size_ms: Time slice duration to estimate frequencies from.
window_stride_ms: How far apart time slices should be.
dct_coefficient_count: Number of frequency bands to analyze.
model_architecture: Name of th
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 562 2018-05-09 11:52 speech_commands\.idea\inspectionProfiles\Project_Default.xm
文件 301 2018-05-09 11:52 speech_commands\.idea\misc.xm
文件 282 2018-05-08 08:29 speech_commands\.idea\modules.xm
文件 398 2018-05-08 08:31 speech_commands\.idea\speech_commands.iml
文件 29967 2018-05-24 09:54 speech_commands\.idea\workspace.xm
文件 5262 2018-05-08 06:19 speech_commands\accuracy_utils.cc
文件 2359 2018-05-08 06:19 speech_commands\accuracy_utils.h
文件 2298 2018-05-08 06:19 speech_commands\accuracy_utils_test.cc
文件 5134 2018-05-08 06:19 speech_commands\BUILD
文件 6965 2018-05-08 06:19 speech_commands\freeze.py
文件 1474 2018-05-08 06:19 speech_commands\freeze_test.py
文件 10939 2018-05-08 06:19 speech_commands\generate_streaming_test_wav.py
文件 1416 2018-05-08 06:19 speech_commands\generate_streaming_test_wav_test.py
文件 23683 2018-05-08 06:19 speech_commands\input_data.py
文件 18132 2018-05-08 11:22 speech_commands\input_data.pyc
文件 8418 2018-05-08 06:19 speech_commands\input_data_test.py
文件 6334 2018-05-08 06:19 speech_commands\label_wav.cc
文件 4683 2018-05-08 06:19 speech_commands\label_wav.py
文件 4842 2018-05-08 06:19 speech_commands\label_wav_dir.py
文件 2298 2018-05-08 06:19 speech_commands\label_wav_test.py
文件 21786 2018-05-08 06:19 speech_commands\models.py
文件 15571 2018-05-08 14:36 speech_commands\models.pyc
文件 3874 2018-05-08 06:19 speech_commands\models_test.py
文件 185 2018-05-08 06:19 speech_commands\README.md
文件 5282 2018-05-08 06:19 speech_commands\recognize_commands.cc
文件 3472 2018-05-08 06:19 speech_commands\recognize_commands.h
文件 3824 2018-05-08 06:19 speech_commands\recognize_commands_test.cc
文件 12670 2018-05-08 06:19 speech_commands\test_streaming_accuracy.cc
文件 16646 2018-05-08 06:19 speech_commands\train.py
目录 0 2018-05-23 14:24 speech_commands\.idea\inspectionProfiles
............此处省略5个文件信息
相关资源
- ISLR和Hands-On Machine Learning with Scikit-L
- CapsNet-Tensorflow
- 深度学习之TensorFlow 入门、原理与进阶
- 基于TensorFlow实现的以多维特征输入的
- 《21个项目玩转深度学习:基于Tenso
- windows+TensorFlow+mask R-CNN
- tensorflow训练CIFAR-10数据集源代码
- Hands-On Machine Learning with Scikit-Learn an
- tensorflow 五种花朵分类识别
- 强化学习精要:核心算法与TensorFlow实
- SPRO 5.0 用户手册PDF
- vgg19网络模型百度云npy和mat格式各一份
- ld3320语音识别程序
- DTW算法C源码语音识别算法
- 语义图像分割 deeplab-v3 tensorflow 源代码
- 基于tensorflow深度学习的中文命名实体
- 炼数成金的TensorFlow教学视频
- 百度语音识别 Unity插件
- 深度学习框架-Tensorflow案例实战视频课
- FasterRCNNTensorFlow源码理解.rar
- labview语音识别系统设计
- SpeechSDK Demo微软语音识别演示中文和日
- TensorflowOpenCV.zip
- 强化学习精要核心算法与TensorFlow实现
- TensorFlow深度学习算法原理与编程实战
- 唐宇迪机器学习视频-tensorflow
- kaldi语音识别教程
- AVR单片机语音识别电路模块设计
- 采用FPGA语音识别系统电路设计
- unity讯飞语音识别demowindows平台
评论
共有 条评论