Scores of Listen and Recognize are different in speech-commands
See original GitHub issueSystem information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js):No
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows10
- TensorFlow.js installed from (npm or script link): npm
- TensorFlow.js version (use command below): 2.8.2
- Browser version: Google Chrome. Version 87.0.4280.88 (Official Build) (x86_64)
Describe the current behavior
I have a recognizer
and used its listen
function to get the Float32Array array from SpeechCommandRecognizerResult.spectrogram.data, then concatenated the array using concatenateFloat32Arrays util function
When using listen
function the scores were fine as expected, but when I use recognize
function and provide the concatenated Float32Array as an input, the scores are different and not as expected
Describe the expected behavior
Expected to have the same or at least similar scores when using recognize
function with input parameter that I got from listen
function
Standalone code to reproduce the issue
Other info / logs Include any logs or source code that would be helpful to
When I use the Float32Array that I got from listen
function and use it as a parameter input in recognize
function, the score is different and the score of the second label is almost always zero
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top GitHub Comments
@adotnusiyan I think you need to normalize the spectrogram before passing to the recognizer: take a look at this line , the normalization method is not exposed, but you can take the source code and try it out. Please let us know if that solve your problem. thanks.
@adotnusiyan btw, the normalization method is exposed in the latest speech-commands v0.5.1