[ preview ]
~/tanjaman
← activity

lamb-sauce

K-ronoPython6 commitsgithub ↗

About

Lamb-sauce is a prototype web app that analyzes recordings of dog barks to estimate a dog's emotional state over time. Built with Streamlit for a hackathon, it lets users upload a .wav audio clip, which the app splits into two-second chunks if it runs longer than five seconds. Each chunk is processed with librosa to extract audio features (MFCCs) and then run through two LSTM neural network models: one that predicts valence (negative, neutral, or positive) and one that predicts arousal (low, medium, or high). These two outputs are combined and mapped to one of nine emotions, such as happy, anxious, playful, aggressive, or excited.

The results are presented through a table showing the predicted emotion for each two-second segment, a timeline chart of how emotions change across the clip, and confidence gauges for the model's predictions. Based on the dominant detected emotion, the app also calls Google's Gemini API to generate possible causes and calming tips for the dog. The models were trained on the public Barkopedia dataset, and the project is built in Python using Keras/TensorFlow for the deep learning components and Plotly for visualization.

My contribution

I worked primarily on the application's core logic in app.py, making a series of updates and refinements to it over time. I also updated the project's dependencies in requirements.txt to keep things current. On top of that, I spent time testing the user interface to make sure everything was working as expected.