{"id":15882805,"url":"https://github.com/chris-santiago/emonet","last_synced_at":"2026-05-05T07:32:32.601Z","repository":{"id":46870112,"uuid":"515677040","full_name":"chris-santiago/emonet","owner":"chris-santiago","description":"CNN-LSTM model for audio emotion detection in children with adverse childhood events.","archived":false,"fork":false,"pushed_at":"2022-07-20T14:55:12.000Z","size":30160,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-31T06:42:36.693Z","etag":null,"topics":["adverse-childhood-events","audio-classification","cnn-lstm","emotion-detection","emotion-recognition","melspectrogram","pytorch","pytorch-lightning","torchaudio","torchvision"],"latest_commit_sha":null,"homepage":"https://chris-santiago.github.io/emonet/","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chris-santiago.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-07-19T17:15:55.000Z","updated_at":"2023-02-25T11:08:19.000Z","dependencies_parsed_at":"2022-09-06T13:40:57.421Z","dependency_job_id":null,"html_url":"https://github.com/chris-santiago/emonet","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/chris-santiago/emonet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-santiago%2Femonet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-santiago%2Femonet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-santiago%2Femonet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-santiago%2Femonet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chris-santiago","download_url":"https://codeload.github.com/chris-santiago/emonet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chris-santiago%2Femonet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32640533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adverse-childhood-events","audio-classification","cnn-lstm","emotion-detection","emotion-recognition","melspectrogram","pytorch","pytorch-lightning","torchaudio","torchvision"],"created_at":"2024-10-06T04:07:13.078Z","updated_at":"2026-05-05T07:32:32.584Z","avatar_url":"https://github.com/chris-santiago.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# emonet\n\n[![DOI](https://zenodo.org/badge/515677040.svg)](https://zenodo.org/badge/latestdoi/515677040)\n\nA package to model negative emotion severity in patients with adverse childhood events (ACE).\n\n**Contributors**: [@chris-santiago](https://github.com/chris-santiago), [@gonzalezeric](https://github.com/gonzalezeric), [@costargc](https://github.com/costargc)\n\n## Installation \u0026 Environment Setup\n\n### Using Docker\n\n1. Open Terminal on Mac or PowerShell on Windows from the **root directory**.\n2. When the application is open, in the command line, build the image using the following: `docker build -t cjsantiago/emonet-model -f docker/model/Dockerfile .`\n3. Run container `docker run -it --name emonet -p 8888:8888 -v \"${HOME}\"/emonet-data:/home/jovyan/emonet-data  cjsantiago/emonet-model`\n   - **Important**: Training the model or running batch inference presumes that you have a `emonet-data` directory within your home folder, containing the original `voice_labeling_report` directory. This will allow you to replicate all batch preprocessing done prior to model training.\n   - You can score file(s) or signal(s), either on their own or with your own custom DataLoader, without the data directory (described above).\n   - See `docker/model/README.md` for more.\n4. Once the container has been created, you may access the files using one of the URLs generated in the CLI. \n\n### Using Conda\n\n1. Clone this repo, then `cd emonet`\n2. Create a virtual environment\n   - For training and notebooks, use `conda env create -f env-base-plus.yml`\n   - For scoring, only, use `conda env create -f env-base-yml`\n3. Install `emonet` package, `pip install -e .`\n\n**NOTE**: We're installing in editable mode (`-e` flag) as we expect to run training and/or scoring\nfrom this cloned repo. Editable mode will symlink source code from the cloned repo directory to the\nappropriate Python interpreter, enabling source code edits and easy-access to our saved models under\nthe `saved_models` directory.\n\n#### Installing ffmpeg\n\n`ffmpeg` is required to convert `.m4a` to `.wav`. On Mac this can be installed via [Homebrew](https://formulae.brew.sh/formula/ffmpeg).  *Skip this if you're running via Docker.*\n\n## Data Setup\n\nTo use our original datset splits, we recommend downloading directly from our S3 bucket. This also\nremoves the need to complete some time-consuming preprocessing steps.\n\n### Download from S3\n\n*Assumes that you have the AWS CLI tool installed on your machine (and that you have our credentials :grinning:)*.\n\nWithin your home folder, create a directory called `emonet-data`. You could also use our directory\nsetup script `python emonet/dir_setup.py`.\n\nFrom the `emonet-data` directory, run this command to sync (copy) the required directories and files\ndirectly from our S3 bucket.\n\n*Note that this assumes our credentials are located within `~/.aws/credentials`*\n\n```bash\naws s3 sync s3://gatech-emonet/eval/ .\n```\n\n### From Scratch\n\nOnce you've setup the environment and installed the `emonet` package:\n\nRun `python emonet/data_setup.py`\n\n**Note:** you can pass an optional number of max_workers to this command; the default is 8 (threads).\n\n`python emonet/data_setup.py 16`\n\nThis script will run and perform the following:\n\n1. dir_setup.py: Set up a data directory within the home folder\n2. m4a_to_wav.py: Convert any `.m4a` files to `.wav`\n3. batch_resample.py: Resample files to 16,000Hz\n4. batch_vad.py: Run voice activity detection (VAD)\n5. data_prep.py: Create train/valid/test splits and respective manifests\n6. wav_splitter.py: Split `.wav` files into 8-second chunks, the create new train/valid/test manifests that use the chunked `.wav` files\n\n## Training\n\nNow that files have all been converted to WAV, preprocessed with VAD and split training, validation and \ntesting sets, and chunked into 8-second segments:\n\n### Command Line Tool\nThe easiest way to run the model is via the CLI:\n\nRun \n\n```bash\npython emonet/train.py \u003cnum_workers\u003e \u003cmax_epochs\u003e \u003cemotion\u003e\n```\n\nand pass in the desired number of `workers`, `epochs` and `emotion`.\n\nExample:\n\n```bash\npython train.py 12 300 anger\n```\n\n### Python\nYou can also train the model in Python:\n\nOpen a .py file or notebook and run\n\n```python\nfrom emonet import DATA_DIR\nfrom emonet.train import main\n\nmain(workers=12, epochs=300, emotion=\"sadness\", use_wandb=False, data_dir=DATA_DIR)\n```\n\nand pass in the desired number of `workers`, `epochs` and `emotion`; you can log runs to Weights \u0026\nBiases by setting `use_wandb=True`, and change the default data directory using the `data_dir` parameter.\n\n## Pretrained Models\n\n**No pretrained models are included in this public-facing repo.**\n\n## Scoring\n\n### Command Line Tool\n\nThe easiest way to score (using our pretrained models) is via our CLI tool, `emonet`.  The syntax for\nthis tool is:\n\n```bash\nemonet \u003cemotion\u003e \u003cfile to score\u003e\n```\n\nExample:\n\n```bash\nemonet anger /Users/christophersantiago/emonet-data/wavs/6529_53113_1602547200.wav\n```\n\n**Note**: This CLI tool will run VAD on the `.wav` file, and can accept arbitrary length-- despite\nmodel being trained on 8-second chunks. Therefore, you should use an original `.wav` of the sample\nyou wish to score, **not** a `.wav` that's been preprocessed with VAD.\n\n### Python\n\nYou can also score via Python:\n\n```python\nfrom emonet import DATA_DIR, ROOT\nfrom emonet.model import EmotionRegressor\n\ndef get_saved(emotion: str):\n    return ROOT.joinpath('saved_models', f'{emotion}.ckpt')\n\n\nemotion = 'fear'\nmodel = EmotionRegressor.load_from_checkpoint(get_saved(emotion))\n\nfile = 'path-to-my-file'\n\nmodel.score_file(file=file, sample_rate=16000, vad=True)\n```\n\nSee `inference.py` for an example of how we scored our testing sets.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-santiago%2Femonet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchris-santiago%2Femonet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchris-santiago%2Femonet/lists"}