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).
YAMNet depends on the following Python packages:
numpy
resampy
tensorflow
pysoundfile
librosa
pyaudio
protobuf
v.3.20.x
$ 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
$ ros2 launch sound_recognition sound_recognition.launch.py
$ ros2 action send_goal /sound_recognition/listen_doorbell sound_recognition_msgs/action/Listen {}
- 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