summaryrefslogtreecommitdiff
path: root/tests/use_case/kws_asr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/use_case/kws_asr')
-rw-r--r--tests/use_case/kws_asr/InferenceTestMicroNetKws.cc (renamed from tests/use_case/kws_asr/InferenceTestDSCNN.cc)10
-rw-r--r--tests/use_case/kws_asr/InitModels.cc6
-rw-r--r--tests/use_case/kws_asr/MfccTests.cc22
3 files changed, 19 insertions, 19 deletions
diff --git a/tests/use_case/kws_asr/InferenceTestDSCNN.cc b/tests/use_case/kws_asr/InferenceTestMicroNetKws.cc
index ad1731b..fd379b6 100644
--- a/tests/use_case/kws_asr/InferenceTestDSCNN.cc
+++ b/tests/use_case/kws_asr/InferenceTestMicroNetKws.cc
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include "DsCnnModel.hpp"
+#include "MicroNetKwsModel.hpp"
#include "hal.h"
#include "TestData_kws.hpp"
#include "TensorFlowLiteMicro.hpp"
@@ -72,8 +72,8 @@ void TestInference(const T* input_goldenFV, const T* output_goldenFV, arm::app::
}
}
-TEST_CASE("Running random inference with Tflu and DsCnnModel Int8", "[DS_CNN]") {
- arm::app::DsCnnModel model{};
+TEST_CASE("Running random inference with Tflu and MicroNetKwsModel Int8", "[MicroNetKws]") {
+ arm::app::MicroNetKwsModel model{};
REQUIRE_FALSE(model.IsInited());
REQUIRE(model.Init());
@@ -82,14 +82,14 @@ TEST_CASE("Running random inference with Tflu and DsCnnModel Int8", "[DS_CNN]")
REQUIRE(RunInferenceRandom(model));
}
-TEST_CASE("Running inference with Tflu and DsCnnModel Uint8", "[DS_CNN]") {
+TEST_CASE("Running inference with Tflu and MicroNetKwsModel Int8", "[MicroNetKws]") {
REQUIRE(NUMBER_OF_IFM_FILES == NUMBER_OF_OFM_FILES);
for (uint32_t i = 0; i < NUMBER_OF_IFM_FILES; ++i) {
const int8_t* input_goldenFV = get_ifm_data_array(i);
const int8_t* output_goldenFV = get_ofm_data_array(i);
DYNAMIC_SECTION("Executing inference with re-init") {
- arm::app::DsCnnModel model{};
+ arm::app::MicroNetKwsModel model{};
REQUIRE_FALSE(model.IsInited());
REQUIRE(model.Init());
diff --git a/tests/use_case/kws_asr/InitModels.cc b/tests/use_case/kws_asr/InitModels.cc
index 770944d..97aa092 100644
--- a/tests/use_case/kws_asr/InitModels.cc
+++ b/tests/use_case/kws_asr/InitModels.cc
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include "DsCnnModel.hpp"
+#include "MicroNetKwsModel.hpp"
#include "Wav2LetterModel.hpp"
#include <catch.hpp>
@@ -22,8 +22,8 @@
/* Skip this test, Wav2LetterModel if not Vela optimized but only from ML-zoo will fail. */
TEST_CASE("Init two Models", "[.]")
{
- arm::app::DsCnnModel model1;
- arm::app::DsCnnModel model2;
+ arm::app::MicroNetKwsModel model1;
+ arm::app::MicroNetKwsModel model2;
/* Ideally we should load the wav2letter model here, but there is
* none available to run on native (ops not supported on unoptimised
diff --git a/tests/use_case/kws_asr/MfccTests.cc b/tests/use_case/kws_asr/MfccTests.cc
index 9509519..c0fb723 100644
--- a/tests/use_case/kws_asr/MfccTests.cc
+++ b/tests/use_case/kws_asr/MfccTests.cc
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include "DsCnnMfcc.hpp"
+#include "MicroNetKwsMfcc.hpp"
#include <algorithm>
#include <catch.hpp>
@@ -93,17 +93,17 @@ const std::vector<float> testWavMfcc {
-22.67135, -0.61615, 2.07233, 0.58137, 1.01655, 0.85816, 0.46039, 0.03393, 1.16511, 0.0072,
};
-arm::app::audio::DsCnnMFCC GetMFCCInstance() {
- const int sampFreq = arm::app::audio::DsCnnMFCC::ms_defaultSamplingFreq;
+arm::app::audio::MicroNetMFCC GetMFCCInstance() {
+ const int sampFreq = arm::app::audio::MicroNetMFCC::ms_defaultSamplingFreq;
const int frameLenMs = 40;
const int frameLenSamples = sampFreq * frameLenMs * 0.001;
const int numMfccFeats = 10;
- return arm::app::audio::DsCnnMFCC(numMfccFeats, frameLenSamples);
+ return arm::app::audio::MicroNetMFCC(numMfccFeats, frameLenSamples);
}
template <class T>
-void TestQuntisedMFCC() {
+void TestQuantisedMFCC() {
const float quantScale = 1.1088106632232666;
const int quantOffset = 95;
std::vector<T> mfccOutput = GetMFCCInstance().MfccComputeQuant<T>(testWav, quantScale, quantOffset);
@@ -118,9 +118,9 @@ void TestQuntisedMFCC() {
REQUIRE(quantizedTestWavMfcc == Approx(mfccOutput[i]).margin(0));
}
}
-template void TestQuntisedMFCC<int8_t>();
-template void TestQuntisedMFCC<uint8_t>();
-template void TestQuntisedMFCC<int16_t>();
+template void TestQuantisedMFCC<int8_t>();
+template void TestQuantisedMFCC<uint8_t>();
+template void TestQuantisedMFCC<int16_t>();
TEST_CASE("MFCC calculation test")
{
@@ -141,16 +141,16 @@ TEST_CASE("MFCC calculation test")
SECTION("int8_t")
{
- TestQuntisedMFCC<int8_t>();
+ TestQuantisedMFCC<int8_t>();
}
SECTION("uint8_t")
{
- TestQuntisedMFCC<uint8_t>();
+ TestQuantisedMFCC<uint8_t>();
}
SECTION("MFCC quant calculation test - int16_t")
{
- TestQuntisedMFCC<int16_t>();
+ TestQuantisedMFCC<int16_t>();
}
} \ No newline at end of file