-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSpeakerVerificationImpl.h
57 lines (39 loc) · 1.18 KB
/
SpeakerVerificationImpl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef NYUMAYA_SPEAKER_VERIFICATION_IMPL_H
#define NYUMAYA_SPEAKER_VERIFICATION_IMPL_H
#include <string>
#include <vector>
#include <list>
#include <iostream>
#include <cstdio>
#include <sys/time.h>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include "tensorflow/lite/interpreter.h"
#include "tensorflow/lite/kernels/register.h"
#include "tensorflow/lite/model.h"
#include "tensorflow/lite/optional_debug_tools.h"
class FeatureExtractor;
class SpeakerVerificationImpl {
public:
SpeakerVerificationImpl(const std::string& modelPath);
~SpeakerVerificationImpl();
uint8_t* VerifySpeaker(const uint8_t* const data,const int mel_length);
void SetThreadCount(size_t val);
size_t get_input_data_size();
private:
uint8_t* interpret();
void PrintDebug();
std::unique_ptr<tflite::Interpreter> interpreter;
std::unique_ptr<tflite::FlatBufferModel> model;
tflite::ops::builtin::BuiltinOpResolver resolver;
int number_of_threads = 1;
bool quantized = false;
static const size_t melcount = 40;
static const size_t melframes = 198;
uint8_t fingerprint[512];
uint8_t melwindow[melcount*melframes];
int output_size;
};
#endif