add vad jni; format code

pull/3026/head
Hui Zhang 3 years ago
parent a718ffe823
commit 27ae3482d4

@ -18,6 +18,11 @@ endif()
project(paddlespeech VERSION 0.1)
set(PPS_VERSION_MAJOR 1)
set(PPS_VERSION_MINOR 0)
set(PPS_VERSION_PATCH 0)
set(PPS_VERSION "${PPS_VERSION_MAJOR}.${PPS_VERSION_MINOR}.${PPS_VERSION_PATCH}")
include(FetchContent)
include(ExternalProject)
@ -163,6 +168,22 @@ include(summary)
###############################################################################
# Add local library
###############################################################################
set(ENGINE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/engine)
set(ENGINE_ROOT ${CMAKE_SOURCE_DIR}/engine)
add_subdirectory(engine)
add_subdirectory(engine)
###############################################################################
# CPack library
###############################################################################
# build a CPack driven installer package
include (InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_NAME "paddlespeech_library")
set(CPACK_PACKAGE_VENDOR "paddlespeech")
set(CPACK_PACKAGE_VERSION_MAJOR 1)
set(CPACK_PACKAGE_VERSION_MINOR 0)
set(CPACK_PACKAGE_VERSION_PATCH 0)
set(CPACK_PACKAGE_DESCRIPTION "paddlespeech library")
set(CPACK_PACKAGE_CONTACT "paddlespeech@baidu.com")
set(CPACK_SOURCE_GENERATOR "TGZ")
include (CPack)

@ -1,9 +1,14 @@
#!/usr/bin/env bash
set -xe
BUILD_ROOT=build/Linux
BUILD_DIR=${BUILD_ROOT}/x86_64
mkdir -p ${BUILD_DIR}
# the build script had verified in the paddlepaddle docker image.
# please follow the instruction below to install PaddlePaddle image.
# https://www.paddlepaddle.org.cn/documentation/docs/zh/install/docker/linux-docker.html
#cmake -B build -DBUILD_SHARED_LIBS=OFF -DWITH_ASR=OFF -DWITH_CLS=OFF -DWITH_VAD=ON -DFASTDEPLOY_INSTALL_DIR=/workspace/zhanghui/paddle/FastDeploy/build/Android/arm64-v8a-api-21/install
cmake -B build -DBUILD_SHARED_LIBS=OFF -DWITH_ASR=OFF -DWITH_CLS=OFF -DWITH_VAD=ON -DFASTDEPLOY_INSTALL_DIR=/workspace/zhanghui/paddle/FastDeploy/build/Linux/x86_64/install
cmake --build build -j
cmake -B ${BUILD_DIR} -DBUILD_SHARED_LIBS=OFF -DWITH_ASR=OFF -DWITH_CLS=OFF -DWITH_VAD=ON -DFASTDEPLOY_INSTALL_DIR=/workspace/zhanghui/paddle/FastDeploy/build/Linux/x86_64/install
cmake --build ${BUILD_DIR} -j

@ -91,13 +91,13 @@ if(ENABLE_VISION)
if(WIN32)
file(GLOB OPENCV_DYN_LIBS ${OpenCV_DIR}/x64/vc15/bin/${DYN_LIB_SUFFIX})
install(FILES ${OPENCV_DYN_LIBS} DESTINATION lib})
install(FILES ${OPENCV_DYN_LIBS} DESTINATION lib)
elseif(ANDROID AND (NOT WITH_ANDROID_OPENCV_STATIC))
file(GLOB OPENCV_DYN_LIBS ${OpenCV_NATIVE_DIR}/libs/${ANDROID_ABI}/${DYN_LIB_SUFFIX})
install(FILES ${OPENCV_DYN_LIBS} DESTINATION lib})
install(FILES ${OPENCV_DYN_LIBS} DESTINATION lib)
else() # linux/mac
file(GLOB OPENCV_DYN_LIBS ${OpenCV_DIR}/lib/${DYN_LIB_SUFFIX})
install(FILES ${OPENCV_DYN_LIBS} DESTINATION lib})
install(FILES ${OPENCV_DYN_LIBS} DESTINATION lib)
endif()
# FlyCV

@ -15,6 +15,7 @@
function(pps_summary)
message(STATUS "")
message(STATUS "*************PaddleSpeech Building Summary**********")
message(STATUS " PPS_VERSION : ${PPS_VERSION}")
message(STATUS " CMake version : ${CMAKE_VERSION}")
message(STATUS " CMake command : ${CMAKE_COMMAND}")
message(STATUS " UNIX : ${UNIX}")

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "decoder/ctc_prefix_beam_search_decoder.h"
#include "base/common.h"
#include "decoder/ctc_prefix_beam_search_decoder.h"
#include "frontend/data_cache.h"
#include "fst/symbol-table.h"
#include "kaldi/util/table-types.h"
@ -117,9 +117,9 @@ int main(int argc, char* argv[]) {
ori_feature_len - chunk_idx * chunk_stride, chunk_size);
}
if (this_chunk_size < receptive_field_length) {
LOG(WARNING) << "utt: " << utt << " skip last "
<< this_chunk_size << " frames, expect is "
<< receptive_field_length;
LOG(WARNING)
<< "utt: " << utt << " skip last " << this_chunk_size
<< " frames, expect is " << receptive_field_length;
break;
}

@ -14,8 +14,8 @@
// todo refactor, repalce with gtest
#include "decoder/ctc_tlg_decoder.h"
#include "base/common.h"
#include "decoder/ctc_tlg_decoder.h"
#include "decoder/param.h"
#include "frontend/data_cache.h"
#include "kaldi/util/table-types.h"

@ -13,12 +13,13 @@
// limitations under the License.
#include "nnet/nnet_producer.h"
#include "matrix/kaldi-matrix.h"
namespace ppspeech {
using std::vector;
using kaldi::BaseFloat;
using std::vector;
NnetProducer::NnetProducer(std::shared_ptr<NnetBase> nnet,
std::shared_ptr<FrontendInterface> frontend)

@ -13,13 +13,13 @@
// limitations under the License.
#include "nnet/u2_nnet.h"
#include "base/common.h"
#include "decoder/param.h"
#include "frontend/assembler.h"
#include "frontend/data_cache.h"
#include "kaldi/util/table-types.h"
#include "nnet/decodable.h"
#include "nnet/u2_nnet.h"
DEFINE_string(feature_rspecifier, "", "test feature rspecifier");
@ -93,9 +93,9 @@ int main(int argc, char* argv[]) {
ori_feature_len - chunk_idx * chunk_stride, chunk_size);
}
if (this_chunk_size < receptive_field_length) {
LOG(WARNING) << "utt: " << utt << " skip last "
<< this_chunk_size << " frames, expect is "
<< receptive_field_length;
LOG(WARNING)
<< "utt: " << utt << " skip last " << this_chunk_size
<< " frames, expect is " << receptive_field_length;
break;
}

@ -13,7 +13,6 @@
// limitations under the License.
#include "nnet/u2_nnet.h"
#include "base/common.h"
#include "decoder/param.h"
#include "frontend/feature_pipeline.h"
@ -21,6 +20,7 @@
#include "kaldi/util/table-types.h"
#include "nnet/decodable.h"
#include "nnet/nnet_producer.h"
#include "nnet/u2_nnet.h"
DEFINE_string(wav_rspecifier, "", "test wav rspecifier");
DEFINE_string(nnet_prob_wspecifier, "", "nnet porb wspecifier");

@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "recognizer/u2_recognizer.h"
#include "common/base/thread_pool.h"
#include "common/utils/file_utils.h"
#include "common/utils/strings.h"
@ -20,6 +19,7 @@
#include "frontend/wave-reader.h"
#include "kaldi/util/table-types.h"
#include "nnet/u2_nnet.h"
#include "recognizer/u2_recognizer.h"
DEFINE_string(wav_rspecifier, "", "test feature rspecifier");
DEFINE_string(result_wspecifier, "", "test result wspecifier");

@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "recognizer/u2_recognizer.h"
#include "decoder/param.h"
#include "frontend/wave-reader.h"
#include "kaldi/util/table-types.h"
#include "recognizer/u2_recognizer.h"
DEFINE_string(wav_rspecifier, "", "test feature rspecifier");
DEFINE_string(result_wspecifier, "", "test result wspecifier");

@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "recognizer/u2_recognizer.h"
#include "decoder/param.h"
#include "frontend/wave-reader.h"
#include "kaldi/util/table-types.h"
#include "recognizer/u2_recognizer.h"
DEFINE_string(wav_rspecifier, "", "test feature rspecifier");
DEFINE_string(result_wspecifier, "", "test result wspecifier");

@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "websocket/websocket_client.h"
#include "kaldi/feat/wave-reader.h"
#include "kaldi/util/kaldi-io.h"
#include "kaldi/util/table-types.h"
#include "websocket/websocket_client.h"
DEFINE_string(host, "127.0.0.1", "host of websocket server");
DEFINE_int32(port, 8082, "port of websocket server");

@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "websocket/websocket_server.h"
#include "decoder/param.h"
#include "websocket/websocket_server.h"
DEFINE_int32(port, 8082, "websocket listening port");

@ -13,6 +13,7 @@
// limitations under the License.
#include "cls/nnet/panns_interface.h"
#include "cls/nnet/panns_nnet.h"
#include "common/base/config.h"

@ -14,6 +14,7 @@
#include <fstream>
#include <string>
#include "base/flags.h"
#include "cls/nnet/panns_interface.h"

@ -28,7 +28,7 @@ typedef int int32; // NOLINT
#if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD)
typedef long int64; // NOLINT
#else
typedef long long int64; // NOLINT
typedef long long int64; // NOLINT
#endif
typedef unsigned char uint8; // NOLINT

@ -15,9 +15,9 @@ using namespace std;
#endif
/*
* \brief Generic configuration Class
*
*/
* \brief Generic configuration Class
*
*/
class Config {
// Data
protected:
@ -35,7 +35,7 @@ class Config {
std::string comment = "#");
Config();
template <class T>
T Read(const std::string& in_key) const; //!<Search for key and read value
T Read(const std::string& in_key) const; //!< Search for key and read value
//! or optional default value, call
//! as read<T>
template <class T>

@ -18,6 +18,9 @@
#pragma once
#include <stdlib.h>
#include <unistd.h>
#include <fstream>
#include <iostream>
#include <mutex>
@ -25,9 +28,6 @@
#include <string>
#include <thread>
#include <stdlib.h>
#include <unistd.h>
#include "base/common.h"
#include "base/macros.h"
#ifndef WITH_GLOG

@ -17,9 +17,8 @@
namespace ppspeech {
using kaldi::BaseFloat;
using std::vector;
using std::vector;
using std::unique_ptr;
using std::vector;
Assembler::Assembler(AssemblerOptions opts,
unique_ptr<FrontendInterface> base_extractor) {

@ -821,12 +821,12 @@ void cftfsub(int n, double *a, int *ip, int nw, double *w) {
} else
#endif /* USE_CDFT_THREADS */
if (n > 512) {
cftrec4(n, a, nw, w);
} else if (n > 128) {
cftleaf(n, 1, a, nw, w);
} else {
cftfx41(n, a, nw, w);
}
cftrec4(n, a, nw, w);
} else if (n > 128) {
cftleaf(n, 1, a, nw, w);
} else {
cftfx41(n, a, nw, w);
}
bitrv2(n, ip, a);
} else if (n == 32) {
cftf161(a, &w[nw - 8]);
@ -868,12 +868,12 @@ void cftbsub(int n, double *a, int *ip, int nw, double *w) {
} else
#endif /* USE_CDFT_THREADS */
if (n > 512) {
cftrec4(n, a, nw, w);
} else if (n > 128) {
cftleaf(n, 1, a, nw, w);
} else {
cftfx41(n, a, nw, w);
}
cftrec4(n, a, nw, w);
} else if (n > 128) {
cftleaf(n, 1, a, nw, w);
} else {
cftfx41(n, a, nw, w);
}
bitrv2conj(n, ip, a);
} else if (n == 32) {
cftf161(a, &w[nw - 8]);

@ -17,12 +17,13 @@
*/
#include "frontend/rfft.h"
#include "base/log.h"
#include <cmath>
#include <memory>
#include <vector>
#include "base/log.h"
// see fftsg.c
#ifdef __cplusplus
extern "C" void rdft(int n, int isgn, double *a, int *ip, double *w);

@ -19,6 +19,8 @@
// See the Apache 2 License for the specific language governing permissions and
// limitations under the License.
#include "frontend/wave-reader.h"
#include <algorithm>
#include <cstdio>
#include <limits>
@ -27,7 +29,6 @@
#include "base/kaldi-error.h"
#include "base/kaldi-utils.h"
#include "frontend/wave-reader.h"
namespace kaldi {
@ -243,10 +244,9 @@ void WaveInfo::Read(std::istream &is) {
<< ", data chunk size: " << data_chunk_size
<< ". Assume 'stream mode' (reading data to EOF).";
if (!is_stream_mode &&
std::abs(static_cast<int64>(riff_chunk_read) +
static_cast<int64>(data_chunk_size) -
static_cast<int64>(riff_chunk_size)) > 1) {
if (!is_stream_mode && std::abs(static_cast<int64>(riff_chunk_read) +
static_cast<int64>(data_chunk_size) -
static_cast<int64>(riff_chunk_size)) > 1) {
// We allow the size to be off by one without warning, because there is
// a
// weirdness in the format of RIFF files that means that the input may

@ -590,7 +590,7 @@ class MatrixBase {
* SpMatrix and use Eig() function there, which uses eigenvalue
* decomposition
* directly rather than SVD.
*/
*/
/// stream read.
/// Use instead of stream<<*this, if you want to add to existing contents.

@ -24,8 +24,10 @@
// limitations under the License.
#include "matrix/kaldi-vector.h"
#include <algorithm>
#include <string>
#include "matrix/kaldi-matrix.h"
namespace kaldi {

@ -90,7 +90,7 @@ typedef uint32 UnsignedMatrixIndexT;
// typedef size_t MatrixIndexT;
// typedef ssize_t SignedMatrixIndexT;
// typedef size_t UnsignedMatrixIndexT;
}
} // namespace kaldi
#endif // KALDI_MATRIX_MATRIX_COMMON_H_

@ -4,4 +4,8 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../
add_subdirectory(nnet)
add_subdirectory(interface)
add_subdirectory(interface)
if(ANDROID)
add_subdirectory(jni)
endif()

@ -17,6 +17,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <string>

@ -2,34 +2,24 @@ set(srcs
vad_interface.cc
)
add_library(vad_interface ${srcs})
target_link_libraries(vad_interface PUBLIC ${FASTDEPLOY_LIBS} vad extern_glog)
add_library(pps_vad_interface ${srcs})
target_link_libraries(pps_vad_interface PUBLIC ${FASTDEPLOY_LIBS} pps_vad)
set(bin_name vad_interface_main)
add_executable(${bin_name} ${CMAKE_CURRENT_SOURCE_DIR}/${bin_name}.cc)
target_link_libraries(${bin_name} ${FASTDEPLOY_LIBS} vad_interface)
target_link_libraries(${bin_name} ${FASTDEPLOY_LIBS} pps_vad_interface)
# set_target_properties(${bin_name} PROPERTIES PUBLIC_HEADER "vad_interface.h;../frontend/wav.h")
install(TARGETS vad_interface DESTINATION lib)
install(FILES vad_interface.h DESTINATION include)
file(RELATIVE_PATH DEST_DIR ${ENGINE_ROOT} ${CMAKE_CURRENT_SOURCE_DIR})
install(TARGETS pps_vad_interface DESTINATION lib)
install(FILES vad_interface.h DESTINATION include/${DEST_DIR})
install(TARGETS vad_interface_main
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include
PUBLIC_HEADER DESTINATION include/${DEST_DIR}
)
install(FILES vad_interface_main.cc DESTINATION demo)
# build a CPack driven installer package
include (InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_NAME "paddlespeech_vad_interface")
set(CPACK_PACKAGE_VENDOR "paddlespeech")
set(CPACK_PACKAGE_VERSION_MAJOR 1)
set(CPACK_PACKAGE_VERSION_MINOR 0)
set(CPACK_PACKAGE_VERSION_PATCH 0)
set(CPACK_PACKAGE_DESCRIPTION "paddlespeech vad interface")
set(CPACK_PACKAGE_CONTACT "paddlespeech@baidu.com")
set(CPACK_SOURCE_GENERATOR "TGZ")
include (CPack)
install(FILES vad_interface_main.cc DESTINATION demo/${DEST_DIR})

@ -14,6 +14,7 @@
#include "vad/interface/vad_interface.h"
#include "common/base/config.h"
#include "vad/nnet/vad.h"

@ -13,10 +13,11 @@
// limitations under the License.
#include "vad/interface/vad_interface.h"
#include <iostream>
#include <vector>
#include "vad/frontend/wav.h"
#include "vad/interface/vad_interface.h"
int main(int argc, char* argv[]) {
if (argc < 3) {

@ -0,0 +1,11 @@
set(srcs
vad_jni_interface.cc
)
add_library(pps_vad_jni_interface ${srcs})
target_link_libraries(pps_vad_jni_interface PUBLIC ${FASTDEPLOY_LIBS} pps_vad_interface)
file(RELATIVE_PATH DEST_DIR ${ENGINE_ROOT} ${CMAKE_CURRENT_SOURCE_DIR})
install(TARGETS pps_vad_jni_interface DESTINATION lib)
install(FILES vad_jni_interface.h DESTINATION include/${DEST_DIR})

@ -0,0 +1,50 @@
// Copyright (c) 2023 PaddlePaddle 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.
#include "vad/jni/vad_jni_interface.h"
JNIEXPORT jlong JNICALL Java_com_baidu_paddlespeech_PPSVadJni_createInstance(
JNIEnv* env, jobject thiz, jstring conf_path) {
const char* path = env->GetStringUTFChars(conf_path, JNI_FALSE);
PPSHandle_t handle = PPSVadCreateInstance(path);
return (jlong)(handle);
}
JNIEXPORT jint JNICALL Java_com_baidu_paddlespeech_PPSVadJni_destoryInstance(
JNIEnv* env, jobject thiz, PPSJniHandle_t instance) {
PPSHandle_t handle = (PPSHandle_t)(instance);
return (jint)PPSVadDestroyInstance(handle);
}
JNIEXPORT jint JNICALL Java_com_baidu_paddlespeech_PPSVadJni_reset(
JNIEnv* env, jobject thiz, PPSJniHandle_t instance) {
PPSHandle_t handle = (PPSHandle_t)(instance);
return (jint)PPSVadReset(handle);
}
JNIEXPORT jint JNICALL Java_com_baidu_paddlespeech_PPSVadJni_chunkSizeSamples(
JNIEnv* env, jobject thiz, PPSJniHandle_t instance) {
PPSHandle_t handle = (PPSHandle_t)(instance);
return (jint)PPSVadChunkSizeSamples(handle);
}
JNIEXPORT jint JNICALL Java_com_baidu_paddlespeech_PPSVadJni_feedForward(
JNIEnv* env, jobject thiz, PPSJniHandle_t instance, jfloatArray chunk) {
PPSHandle_t handle = (PPSHandle_t)(instance);
jsize num_elms = env->GetArrayLength(chunk);
jfloat* chunk_ptr = env->GetFloatArrayElements(chunk, JNI_FALSE);
return (jint)PPSVadFeedForward(handle, (float*)chunk_ptr, (int)num_elms);
}

@ -0,0 +1,57 @@
// Copyright (c) 2023 PaddlePaddle 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.
// PackageName: paddlespeech.baidu.com
// ClassName: PPSVadJni
#include <jni.h>
#include "vad/interface/vad_interface.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef jlong PPSJniHandle_t;
JNIEXPORT PPSJniHandle_t JNICALL
Java_com_baidu_paddlespeech_PPSVadJni_createInstance(JNIEnv* env,
jobject thiz,
jstring conf_path);
JNIEXPORT jint JNICALL Java_com_baidu_paddlespeech_PPSVadJni_destoryInstance(
JNIEnv* env, jobject thiz, PPSJniHandle_t instance);
JNIEXPORT jint JNICALL Java_com_baidu_paddlespeech_PPSVadJni_reset(
JNIEnv* env, jobject thiz, PPSJniHandle_t instance);
JNIEXPORT jint JNICALL Java_com_baidu_paddlespeech_PPSVadJni_chunkSizeSamples(
JNIEnv* env, jobject thiz, PPSJniHandle_t instance);
// typedef enum {
// PPS_VAD_ILLEGAL = 0, // error
// PPS_VAD_SIL, // silence
// PPS_VAD_START, // start speech
// PPS_VAD_SPEECH, // in speech
// PPS_VAD_END, // end speech
// PPS_VAD_NUMSTATES, // number of states
// } PPSVadState_t;
JNIEXPORT jint JNICALL Java_com_baidu_paddlespeech_PPSVadJni_feedForward(
JNIEnv* env, jobject thiz, PPSJniHandle_t instance, jfloatArray chunk);
#ifdef __cplusplus
}
#endif

@ -2,11 +2,15 @@ set(srcs
vad.cc
)
add_library(vad ${srcs})
target_link_libraries(vad PUBLIC ${FASTDEPLOY_LIBS} common)
add_library(pps_vad ${srcs})
target_link_libraries(pps_vad PUBLIC ${FASTDEPLOY_LIBS} common)
set(bin_name vad_nnet_main)
add_executable(${bin_name} ${CMAKE_CURRENT_SOURCE_DIR}/${bin_name}.cc)
# target_link_libraries(${bin_name} ${FASTDEPLOY_LIBS} vad gflags extern_glog)
target_link_libraries(${bin_name} ${FASTDEPLOY_LIBS} vad)
target_link_libraries(${bin_name} ${FASTDEPLOY_LIBS} pps_vad)
file(RELATIVE_PATH DEST_DIR ${ENGINE_ROOT} ${CMAKE_CURRENT_SOURCE_DIR})
install(TARGETS pps_vad DESTINATION lib)

@ -13,14 +13,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "vad/nnet/vad.h"
#include <cstring>
#include <iomanip>
#ifdef NDEBUG
#define LOG_DEBUG \
::fastdeploy::FDLogger(true, "[DEBUG]") << __REL_FILE__ << "(" << __LINE__ \
<< ")::" << __FUNCTION__ << "\t"
#define LOG_DEBUG \
::fastdeploy::FDLogger(true, "[DEBUG]") \
<< __REL_FILE__ << "(" << __LINE__ << ")::" << __FUNCTION__ << "\t"
#else
#define LOG_DEBUG \
::fastdeploy::FDLogger(false, "[DEBUG]") \
@ -323,4 +324,4 @@ std::ostream& operator<<(std::ostream& os, const Vad::State& s) {
return os;
}
} // namepsace ppspeech
} // namespace ppspeech

@ -17,6 +17,7 @@
#include <iostream>
#include <mutex>
#include <vector>
#include "fastdeploy/fastdeploy_model.h"
#include "fastdeploy/runtime.h"
#include "vad/frontend/wav.h"
@ -149,4 +150,4 @@ class Vad : public fastdeploy::FastDeployModel {
const std::vector<int64_t> hc_node_dims_ = {2, 1, 64};
};
} // namepsace ppspeech
} // namespace ppspeech
Loading…
Cancel
Save