Code Monkey home page Code Monkey logo

openvino_noise_suppression_demo_mic's Introduction

OpenVINO Noise Supression Demo (Mic Input/Speaker Output Support Version)

This program is a customized version of Noise Suppression Python* Demo in OpenVINO Open Model Zoo Demos. This version supports to input sound from mic device and output noise suppressed sound to speaker device.

Prerequisites

  • Ubuntu 20.04
  • Python 3.8
  • OpenVINO 2022.1

Setup

Install modules

sudo apt install portaudio19-dev
pip install -r requirements.txt

Download Pre-trained Model

pip install openvino-dev
omz_downloader --name noise-suppression-poconetlike-0001 

Test

Case 1: Use audio file.

wget https://assets.amazon.science/ef/0b/234f82204da385f4893a150d7e34/sample01-orig.wav
python noise_suppression_demo_mic.py -m intel/noise-suppression-poconetlike-0001/FP32/noise-suppression-poconetlike-0001.xml -i sample01-orig.wav -o sample01-output.wav
aplay -D plughw:2,0 sample01-output.wav

Case 2: Use sound input/output devices.

  1. Dump index of audio device by using -l option.
python noise_suppression_demo_mic.py -l 
  1. Pick up index numbers for mic and speaker devices in output message of the above command.
{'index': 10, 'structVersion': 2, 'name': 'HDA Intel PCH: HDMI 10 (hw:0,16)', 'hostApi': 0, 'maxInputChannels': 0, 'maxOutputChannels': 8, 'defaultLowInputLatency': -1.0, 'defaultLowOutputLatency': 0.008707482993197279, 'defaultHighInputLatency': -1.0, 'defaultHighOutputLatency': 0.034829931972789115, 'defaultSampleRate': 44100.0}
{'index': 11, 'structVersion': 2, 'name': 'USB PnP Sound Device: Audio (hw:1,0)', 'hostApi': 0, 'maxInputChannels': 1, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.008707482993197279, 'defaultLowOutputLatency': -1.0, 'defaultHighInputLatency': 0.034829931972789115, 'defaultHighOutputLatency': -1.0, 'defaultSampleRate': 44100.0}
{'index': 12, 'structVersion': 2, 'name': 'Logitech USB Headset: Audio (hw:2,0)', 'hostApi': 0, 'maxInputChannels': 1, 'maxOutputChannels': 2, 'defaultLowInputLatency': 0.008707482993197279, 'defaultLowOutputLatency': 0.008707482993197279, 'defaultHighInputLatency': 0.034829931972789115, 'defaultHighOutputLatency': 0.034829931972789115, 'defaultSampleRate': 44100.0}
  1. Run demo by specifying index numbers above.
python noise_suppression_demo_mic.py -m intel/noise-suppression-poconetlike-0001/FP32/noise-suppression-poconetlike-0001.xml --device_input 11 --device_output 12 -i test_input.wav -o test_output.wav -t 50
usage: noise_suppression_demo_mic.py [-h] -m MODEL [-i INPUT] [-o OUTPUT] [-d DEVICE] [--device_input DEVICE_INPUT] [--device_output DEVICE_OUTPUT] [--skip_infer] [-t RECORD_TIME] [-l]

Options:
  -h, --help            Show this help message and exit.
  -m MODEL, --model MODEL
                        Required. Path to an .xml file with a trained model
  -i INPUT, --input INPUT
                        Optional. Path to a 16kHz wav file with speech+noise
  -o OUTPUT, --output OUTPUT
                        Optional. Path to output wav file for cleaned speech
  -d DEVICE, --device DEVICE
                        Optional. Target device to perform inference on. Default value is CPU
  --device_input DEVICE_INPUT
                        Optional. device id for input
  --device_output DEVICE_OUTPUT
                        Optional. device id for output
  --skip_infer          Optional. skip inference
  -t RECORD_TIME, --record_time RECORD_TIME
                        Optional. Recording time [sec]
  -l, --list_device     Optional. show a list of audio device

Note

  • OpenVINO API 2.0 is used. Inference Engine API is not supported.
  • Not support noise-suppression-denseunet-ll-0001

openvino_noise_suppression_demo_mic's People

Contributors

dtoya avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.