• Stars
    star
    118
  • Rank 298,794 (Top 6 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Laugh Detector

This is the code accompanying blog posts (Here and Here) for training and running a laugh detector. This project is based on AudioSet and includes a rebalanced subset of their data and utilizes their pre-trained audio feature vectorizer vggish. I also followed the lead of a similar project for processing the AudioSet data and choosing network architectures

This repo contains code for running live inference of the presence of laughter, a few pre-trained models, code that was used for training, a subset of the AudioSet data containing a balanced set of laughter and non-laughter human speech and a dashboard for visualizing the amount of laughter.

Running Live Inference

Running live_inference.py will use your computer's microphone to capture audio and infer the presence of laughter in segmented chunks. These scores can be written to a time-stamped .csv and/or used to control a wireless light on a Philips Hue bridge.

Setup

First, install the python requirements: pip install -r requirements.txt

You will then need to download vggish_model.ckpt from AudioSet and move it to the audioset directory to run the vggish model.

You will also need to install Portaudio to run the live inference script. On macOS you can accomplish this with homebrew

$ brew install portaudio

Running the Detector

You can run the laugh detector using a pre-trained model from the command line

$ python live_inference.py --save_file='\path\to\output.csv'

If you want to control a Philips Hue bulb, first get the IP address of your bridge, then run

$ python live_inference.py --hue_lights='True' --hue_IP='your.bridge.ip.address'

The first time you run this, you will need to press the connection button within 30 seconds of the phue library loading. See the phue library if you have trouble connecting

Using the Dashboard

The dashboard is built using Dash, you can run it with

$ python dashboard/dashboard.py

It is currently working on a sample data set, but you can edit the file to point to a new datafile.

Training Your Own Models

This repo contains three pre-trained models in the Models directory. You can run the code in Notebooks/ModelTraining.ipynb to repeat the training process or to use it as a skeleton for training your own models. This notebook uses keras-tqdm for the progress bars, which doesn't play well with JupyterLab. You can either run the notebook in a classic Jupyter Notebook or disable keras-tqdm, it won't change the training process.

This repo contains two processed subsets of the AudioSet data: a training set of 18,768 samples where half the data has a laughter label (including "Laughter", "Baby laughter", "Giggle", "Snicker", "Belly laugh", and "Chuckle, chortle") and the other half has a non-laughter human noise label (including "Speech", "Male speech, man speaking", "Female speech, woman speaking", "Child speech, kid speaking", "Conversation", "Narration, monologue", "Babbling", "Crowd", and "Hubbub, speech noise, speech babble"). Samples can have multiple labels, but a positive "laughter" label is only assigned if one of the laughter labels is present and a negative label affirms the absence of any laughter label. The evaluation set contains 568 samples from the evaluation data with the same distribution. These rebalanced datasets are in Data/bal_laugh_speech_subset.tfrecord and Data/eval_laugh_speech_subset.tfrecord respectively.

The pre-trained models and re-balanced subset data are all licensed under a Creative Commons Attribution 4.0 International License.

If you want to create your own processed subset of the AudioSet data on a different collection of labels, you can follow the code in Notebooks/AudiosetProcessing.ipynb. You can create your own subsets of the Audioset data by creating a list of labels to use for the positive and negative cases.

More Repositories

1

stanley-bot

Stanley is a custom SMS messaging platform to prototype early services, products, and content
PHP
135
star
2

Figproxy

Software that allows Figma to talk to hardware, enabling the creation of rapid prototypes of physical devices.
Swift
103
star
3

catcorrjs

Visualize correlations across many dimensions of categorical data (e.g., from a survey)
JavaScript
96
star
4

shape

The future of collaborative work
JavaScript
37
star
5

NorumIpnum

A “Lorum Ipsum” numeral font for use in mockups to represent placeholder data.
27
star
6

generative-kandinsky

Inspired by Kandinsky’s Circles in a Circle
JavaScript
12
star
7

ember-contentful

An Ember addon that makes it easier to work with Contentful
JavaScript
9
star
8

Cigar_Mic_DC24

Hardware and Software files for a cigar shaped microphone PCB that was designed to add functionality to AND!XOR's Bender Badge for DEF CON 24
Eagle
5
star
9

frequency-is-freedom

Jupyter Notebook
4
star
10

colab-styleguide

The coLAB living styleguide
HTML
4
star
11

HelloWorkflow

Example repo to demonstrate IDEO software collaboration best practices.
3
star
12

BasicSimbleeApp

Basic Simblee app for connected the Sparkfun Simblee breakout to a custom iOS app
Objective-C
3
star
13

eyeo-flower

Custom SAMD21E17D Arduino compatible board for Eyeo Festival 2022 workshop
3
star
14

audio_transcription

A Python wrapper for the Google Cloud Speech-to-Text API
Python
3
star
15

chIDEOiOS

chIDEO iBeacon iOS App
Swift
2
star
16

ideo-links

JavaScript
2
star
17

dCampTokyo2020

Workshop tools for d.camp Tokyo 2020
HTML
2
star
18

DS-toy-models

Jupyter Notebook
2
star
19

Abracon_RTC_Arduino_Library

Arduino library for communicating with the Abracon AB-RTCMC-32.768kHz-EOZ9-S3 real time clock
C++
2
star
20

reddit-topic-modeler

An interactive Topic Modeler powered by BERTopic and our very own Reddit scraper
Python
2
star
21

chibonysoftware

Documentation / best practices / archives for the IDEO ChiBoNy software discipline
1
star
22

creative-tensions

Repository for Creative Tensions website
JavaScript
1
star
23

avocado-allegory

A guacamole-based voting simulation
Jupyter Notebook
1
star
24

widschicago-2021

visualizations, https://widschicago.org/
CSS
1
star
25

LaughLaboratory-Dashboard

Dashboard for the Comedy Experiment - Laugh Laboratory
Jupyter Notebook
1
star
26

Imagination-Demo

JavaScript
1
star
27

omi-boilerplates

Setup code and boilerplates for OMI hackathon.
JavaScript
1
star
28

c-delta-challenge

A Rails/HTML/CSS/React challenge for creative coders.
Ruby
1
star