Coder Social home page Coder Social logo

huakunyang / summerasr Goto Github PK

View Code? Open in Web Editor NEW
76.0 7.0 7.0 3.64 MB

SummerAsr 是一个基于C++的可独立编译且几乎没有额外依赖库的本地中文语音识别器。 Summer Asr is a Chinese automatic speech recognize project written with C++ that can be easily built standalone without any depencency.

CMake 2.36% C++ 81.39% C 6.12% Shell 0.17% HTML 0.13% Cuda 1.00% Fortran 8.62% XSLT 0.04% Python 0.08% JavaScript 0.05% CSS 0.04% Makefile 0.01%
asr speech-recognition nodependence standalone cplusplus

summerasr's Introduction

SummerAsr 用于纪念2023年即将到来和终将逝去的夏天

说明

  • SummerAsr 是一个独立编译的大范围连续语音识别系统(ASR),是一个可以本地运行的系统,不需要连接网络,而且没有其他依赖,一键编译完成即可进行语音识别。
  • SummerAsr 识别的WAV(PCM)数据格式为: 16K 采样率,16bits int
  • SummerAsr 的底层计算库使用Eigen,Eigen是一套模板定义的函数,大部分情况下,只需要包含头文件即可,所以本项目没有其他依赖,在C++环境下可以独立编译和运行。
  • 本项目使用Eigen提供的矩阵库实现了神经网络的算子,不需要依赖例如pytorch,tensorflow, ncnn 等其他NN运行环境。
  • 本项目在 Ubuntu 上编译运行通过,其他类Linux平台,如Android,树莓派等,也应该没啥大问题,在Window上没有测试过,可能需要少许改动。

使用说明

  • 将本项目的代码克隆到本地,最好是Ubuntu Linux 环境

  • 从以下的百度网盘地址下载模型,放入本项目的model目录中:
    链接: https://pan.baidu.com/s/13KgAaD79Pd3XsWI6k6VViw?pwd=y4rd 提取码: y4rd

    目录结构和内容如下:
    model
    ├── am.model
    ├── char.txt
    └── lm.model

  • 进入Build 目录,执行以下命令:
    cmake ..
    make

  • 编译完成后,会在Build 目录中生成 asr_test 执行程序

  • 运行下列命令,测试语音识别:
    ./asr_test ../wavSamples/test.wav

  • 正常情况下,可得到如下结果

    Model loading time costs:0.236086s
    Asr Result: 今天是二零二二年五月四号现在是晚上十一点五十三分
    Wav duration: 9.25s, Asr Decoding time costs: 3.35407s, RTF: 0.362602

后续开发

  • 后续将开放模型训练和转化脚本

联系作者

  • 有进一步的问题或需要可以发邮件到 [email protected] , 或添加微信: hwang_2011, 本人尽量回复。

感谢

本项目在源代码和算法方面使用了下列方案,在此表示感谢, 若可能引发任何法律问题,请及时联系我协调解决

summerasr's People

Contributors

huakunyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

summerasr's Issues

make error on windows

after enter mingw32-make , got following:

[  1%] Building CXX object CMakeFiles/asr_test.dir/src/am/am.cpp.obj
[  3%] Building CXX object CMakeFiles/asr_test.dir/src/asr/asr.cpp.obj
[  5%] Building CXX object CMakeFiles/asr_test.dir/src/decoder/ctc_beam_search_decoder.cpp.obj
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:12:32: error: 'numeric_limits' is not a member of 'std'
   12 | const float NUM_FLT_INF = std::numeric_limits<float>::max();
      |                                ^~~~~~~~~~~~~~
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:12:47: error: expected primary-expression before 'float'
   12 | const float NUM_FLT_INF = std::numeric_limits<float>::max();
      |                                               ^~~~~
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:13:32: error: 'numeric_limits' is not a member of 'std'
   13 | const float NUM_FLT_MIN = std::numeric_limits<float>::min();
      |                                ^~~~~~~~~~~~~~
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:13:47: error: expected primary-expression before 'float'
   13 | const float NUM_FLT_MIN = std::numeric_limits<float>::min();
      |                                               ^~~~~
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp: In function 'T log_sum_exp(const T&, const T&)':
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:19:34: error: 'numeric_limits' is not a member of 'std'
   19 |         static T num_min = -std::numeric_limits<T>::max();
      |                                  ^~~~~~~~~~~~~~
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:19:50: error: expected primary-expression before '>' token
   19 |         static T num_min = -std::numeric_limits<T>::max();
      |                                                  ^
E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:19:53: error: '::max' has not been declared; did you mean 'std::max'?
   19 |         static T num_min = -std::numeric_limits<T>::max();
      |                                                     ^~~
      |                                                     std::max
In file included from D:/TODO/mingw-w64/lib/gcc/x86_64-w64-mingw32/12.2.0/include/c++/algorithm:61,
                 from E:\SummerAsr-master\src\decoder\ctc_beam_search_decoder.cpp:4:
D:/TODO/mingw-w64/lib/gcc/x86_64-w64-mingw32/12.2.0/include/c++/bits/stl_algo.h:5756:5: note: 'std::max' declared here
 5756 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
mingw32-make[2]: *** [CMakeFiles\asr_test.dir\build.make:111: CMakeFiles/asr_test.dir/src/decoder/ctc_beam_search_decoder.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:95: CMakeFiles/asr_test.dir/all] Error 2
mingw32-make: *** [Makefile:103: all] Error 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.