Skip to content

MERLIN2-ARCH/sound_recognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sound_recognition

This repo constains code for sound classification (like doorbell detection) under ROS 2 architecture using the YAMNet pretrained deep net that predicts 521 audio event classes based on the AudioSet-YouTube corpus (https://github.com/tensorflow/models/tree/master/research/audioset/yamnet).

Installation

YAMNet depends on the following Python packages:

$ pip3 install numpy resampy tensorflow soundfile librosa pyaudio
$ cd ~/ros2_ws/src
$ git clone git@github.com:MERLIN2-ARCH/sound_recognition.git
$ cd sound_recognition
$ vcs import ~/ros2_ws/src < third_parties.repos
$ cd ~/ros2_ws
$ colcon build

Usage

Launch

$ ros2 launch sound_recognition sound_recognition.launch.py

Shell example

$ ros2 action send_goal /sound_recognition/listen_doorbell sound_recognition_msgs/action/Listen {}

Services

  • Service to start the doorbell detection:

service: /sound_recognition/start_ad_listening

type: std_srvs/srv/Empty

$ ros2 service call /sound_recognition/start_ad_listening std_srvs/srv/Empty
  • Service to stop the doorbell detection:

service: /sound_recognition/stop_ad_listening

type: std_srvs/srv/Empty

$ ros2 service call /sound_recognition/stop_ad_listening std_srvs/srv/Empty

Releases

No releases published

Packages

No packages published