Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork56.4k
speech recognition sample#20291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
l-bat commentedJun 23, 2021
Please add description at the beginning of sample as in opencv/samples/dnn/human_parsing.py Lines 2 to 40 inb74aae6
|
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
samples/dnn/speech_recognition.py Outdated
| if __name__ == '__main__': | ||
| # Computation backends supported by layers | ||
| backends = (cv.dnn.DNN_BACKEND_DEFAULT, cv.dnn.DNN_BACKEND_OPENCV) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Could you try forward net with OpenVINO (cv.dnn.DNN_BACKEND_INFERENCE_ENGINE)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I tried. It gave this error:error: (-213:The function/feature is not implemented) Unknown backend identifier in function 'cv::dnn::dnn4_v20210301::wrapMat'
Uh oh!
There was an error while loading.Please reload this page.
samples/dnn/speech_recognition.py Outdated
| parser = argparse.ArgumentParser(description='This script runs Jasper Speech recognition model', | ||
| formatter_class=argparse.ArgumentDefaultsHelpFormatter) | ||
| parser.add_argument('--input_audio', type=str, help='Path to input audio file.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do we need to specify supported audio formats?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think we need to addrequired=True
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Finally, we need to use AudioIO. So, should I add the formats supported there? I suppose mp3, wav and mp4 are supported.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
alalek commentedAug 22, 2021
@spazewalker Could you please check if approach from#20558 works for this case? |
spazewalker commentedAug 22, 2021
@alalek Just tested it. It works for this case. |
support for multiple files at once
Co-authored-by: Liubov Batanina <piccione-mail@yandex.ru>fix whitespaces
alalek commentedSep 27, 2021
Lets merge it with @spazewalker Please make PR to "Ready for review" if it is ready for merging. |
alalek commentedOct 2, 2021
@spazewalker Ping. Or let us know if you want to improve something else. |
spazewalker commentedOct 3, 2021
alalek left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thank you 👍
speech recognition sample* speech recognition sample added.(initial commit)* fixed typos, removed plt* trailing whitespaces removed* masking removed and using opencv for displaying spectrogram* description added* requested changes and add opencl fp16 target* parenthesis and halide removed* workaround 3d matrix issue* handle multi channel audiosupport for multiple files at once* suggested changesfix whitespaces
Uh oh!
There was an error while loading.Please reload this page.
GSoC 2021: Speech Recognition using OpenCV AudioIO
Project details
PR details
Creating ONNX model
NVIDIA trained jasper using FP16 precision. OpenCV needs FP32. We need to change onnx model's graph. This is done using this script :convert_jasper_to_FP32.py. Pre-trained converted onnx can be foundhere. Original pre-trained model by NVIDIA can be foundhere.
Usage
usage: speech_recognition.py [-h] --input_audio INPUT_AUDIO [--show_spectrogram] [--model MODEL] [--output OUTPUT] [--backend {0,2,3}] [--target {0,1,2}]This script runs Jasper Speech recognition modeloptional arguments: -h, --help show thishelp message andexit --input_audio INPUT_AUDIO Path to input audio file. OR Path to a txt file with relative path to multiple audio filesin different lines (default: None) --show_spectrogram Whether to show a spectrogram of the input audio. (default: False) --model MODEL Path to the onnx file of Jasper. default="jasper.onnx" (default: jasper.onnx) --output OUTPUT Path to file where recognized audio transcript must be saved. Leave this to print on console. (default: None) --backend {0,2,3} Select a computation backend: 0: automatically (by default) 2: OpenVINO Inference Engine 3: OpenCV Implementation (default: 0) --target {0,1,2} Select a target device: 0: CPU target (by default) 1: OpenCL 2: OpenCL FP16 (default: 0)Todo
Pull Request Readiness Checklist
See details athttps://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.