Metadata-Version: 2.1
Name: mexca
Version: 0.7.0
Summary: Emotion expression capture from multiple modalities.
Home-page: https://github.com/mexca/mexca
Author: Malte Luken
Author-email: m.luken@esciencecenter.nl
Project-URL: Bug Tracker, https://github.com/mexca/mexca/issues
Keywords: emotion,multimodal,expression
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: <3.11,>3.7
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: docker >=6.0.1
Requires-Dist: intervaltree >=3.1.0
Requires-Dist: moviepy >=1.0.3
Requires-Dist: numpy <1.24,>=1.21
Requires-Dist: polars ==0.19.8
Requires-Dist: pydantic ==2.4.2
Requires-Dist: pyyaml >=6.0
Requires-Dist: scipy >=1.7.3
Requires-Dist: srt >=3.5.2
Requires-Dist: tqdm >=4.64.0
Provides-Extra: all
Requires-Dist: mexca[sen,spe,tra,vid,voi] ; extra == 'all'
Provides-Extra: demo
Requires-Dist: ipywidgets ; extra == 'demo'
Requires-Dist: notebook ; extra == 'demo'
Provides-Extra: dev
Requires-Dist: black ; extra == 'dev'
Requires-Dist: bump2version ; extra == 'dev'
Requires-Dist: prospector[with_pyroma] ==1.7.7 ; extra == 'dev'
Requires-Dist: pre-commit ; extra == 'dev'
Requires-Dist: pylint ==2.15.6 ; extra == 'dev'
Requires-Dist: isort ; extra == 'dev'
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: pytest-cov ; extra == 'dev'
Requires-Dist: sphinx ; extra == 'dev'
Requires-Dist: sphinx-rtd-theme ; extra == 'dev'
Requires-Dist: sphinx-autoapi ; extra == 'dev'
Requires-Dist: tox ; extra == 'dev'
Requires-Dist: myst-parser ; extra == 'dev'
Provides-Extra: publishing
Requires-Dist: twine ; extra == 'publishing'
Requires-Dist: wheel ; extra == 'publishing'
Provides-Extra: sen
Requires-Dist: accelerate ==0.18.0 ; extra == 'sen'
Requires-Dist: bitsandbytes ==0.38.1 ; extra == 'sen'
Requires-Dist: protobuf ==3.20 ; extra == 'sen'
Requires-Dist: sentencepiece ; extra == 'sen'
Requires-Dist: torch >=2.0 ; extra == 'sen'
Requires-Dist: transformers ==4.25.1 ; extra == 'sen'
Provides-Extra: spe
Requires-Dist: pyannote.audio ==3.0.0 ; extra == 'spe'
Requires-Dist: pyannote.core >=5.0 ; extra == 'spe'
Requires-Dist: ruamel.yaml ==0.17.28 ; extra == 'spe'
Requires-Dist: torch >=2.0 ; extra == 'spe'
Requires-Dist: onnxruntime ; (platform_system == "Darwin") and extra == 'spe'
Requires-Dist: torchaudio ==2.0.0 ; (platform_system == "Darwin") and extra == 'spe'
Requires-Dist: onnxruntime-gpu ; (platform_system == "Windows" or platform_system == "Linux") and extra == 'spe'
Provides-Extra: tra
Requires-Dist: openai-whisper ; extra == 'tra'
Requires-Dist: torch >=2.0 ; extra == 'tra'
Requires-Dist: transformers ==4.25.1 ; extra == 'tra'
Provides-Extra: vid
Requires-Dist: facenet-pytorch ==2.5.2 ; extra == 'vid'
Requires-Dist: gdown ==4.7.1 ; extra == 'vid'
Requires-Dist: av ==10.0 ; extra == 'vid'
Requires-Dist: scikit-learn ==1.3.1 ; extra == 'vid'
Requires-Dist: spectralcluster ==0.2.16 ; extra == 'vid'
Requires-Dist: torch >=2.0 ; extra == 'vid'
Provides-Extra: voi
Requires-Dist: emvoice ; extra == 'voi'
Requires-Dist: librosa <0.10.0 ; extra == 'voi'


# Multimodal Emotion Expression Capture Amsterdam

[![github license badge](https://img.shields.io/github/license/mexca/mexca)](https://github.com/mexca/mexca)
[![RSD](https://img.shields.io/badge/rsd-mexca-00a3e3.svg)](https://research-software-directory.org/software/mexca)
[![read the docs badge](https://readthedocs.org/projects/pip/badge/)](https://mexca.readthedocs.io/en/latest/index.html)
[![fair-software badge](https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8B-yellow)](https://fair-software.eu)
[![workflow scq badge](https://sonarcloud.io/api/project_badges/measure?project=mexca_mexca&metric=alert_status)](https://sonarcloud.io/dashboard?id=mexca_mexca)
[![workflow scc badge](https://sonarcloud.io/api/project_badges/measure?project=mexca_mexca&metric=coverage)](https://sonarcloud.io/dashboard?id=mexca_mexca)
[![build](https://github.com/mexca/mexca/actions/workflows/build.yml/badge.svg)](https://github.com/mexca/mexca/actions/workflows/build.yml)
[![cffconvert](https://github.com/mexca/mexca/actions/workflows/cffconvert.yml/badge.svg)](https://github.com/mexca/mexca/actions/workflows/cffconvert.yml)
[![markdown-link-check](https://github.com/mexca/mexca/actions/workflows/markdown-link-check.yml/badge.svg)](https://github.com/mexca/mexca/actions/workflows/markdown-link-check.yml)
[![DOI](https://zenodo.org/badge/500818250.svg)](https://zenodo.org/badge/latestdoi/500818250)
[![docker hub badge](https://img.shields.io/static/v1?label=Docker%20Hub&message=mexca&color=blue&style=flat&logo=docker)](https://hub.docker.com/u/mexca)
[![docker build badge](https://img.shields.io/github/actions/workflow/status/mexca/mexca/docker.yml?label=Docker%20build&logo=docker)](https://github.com/mexca/mexca/actions/workflows/docker.yml)
[![black code style badge](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

<div align="center">
<img src="mexca_logo.png" width="400">
</div>

mexca is an open-source Python package which aims to capture human emotion expressions from videos in a single pipeline.

## How To Use Mexca

mexca implements the customizable yet easy-to-use Multimodal Emotion eXpression Capture Amsterdam (MEXCA) pipeline for extracting emotion expression features from videos.
It contains building blocks that can be used to extract features for individual modalities (i.e., facial expressions, voice, and dialogue/spoken text).
The blocks can also be integrated into a single pipeline to extract the features from all modalities at once.
Next to extracting features, mexca can also identify the speakers shown in the video by clustering speaker and face representations.
This allows users to compare emotion expressions across speakers, time, and contexts.

Please cite mexca if you use it for scientific or commercial purposes.

<div align="center">
<img src="docs/mexca_flowchart.png" width="600">
</div>

## Installation

mexca can be installed on Windows, macOS and Linux. We recommend Windows 10, macOS 12.6.x, or Ubuntu. The base package can be installed from PyPI via `pip`:

```console
pip install mexca
```

The dependencies for the additional components can be installed via:

```console
pip install mexca[vid,spe,voi,tra,sen]
```

or:

```console
pip install mexca[all]
```

The abbreviations indicate:

* `vid`: FaceExtractor
* `spe`: SpeakerIdentifier
* `voi`: VoiceExtractor
* `tra`: AudioTranscriber
* `sen`: SentimentExtractor

For details on the requirements and installation procedure, see the [Quick Installation](https://mexca.readthedocs.io/en/latest/quick_installation.html) and [Installation Details](https://mexca.readthedocs.io/en/latest/installation_details.html) sections of our documentation.

## Getting Started

If you would like to learn how to use mexca, take a look at our [demo](https://github.com/mexca/mexca/tree/main/examples) notebook and the [Getting Started](https://mexca.readthedocs.io/en/latest/getting_started.html) section of our documentation.

## Examples and Recipes

In the `examples/` folder, we currently provide two Jupyter notebooks (and a short demo):

- [example_custom_pipeline_components](https://github.com/mexca/mexca/blob/main/examples/example_custom_pipeline_components.ipynb) shows how the standard MEXCA pipeline can be customized and extended
- [example_emotion_feature_extraction](https://github.com/mexca/mexca/blob/main/examples/example_emotion_feature_extraction.ipynb) shows how to apply the MEXCA pipeline to a video and conduct a basic analysis of the extracted features

The `recipes/` folder contains two Python scripts that can easily be reused in a new project:

- [recipe_postprocess_features](https://github.com/mexca/mexca/blob/main/recipes/recipe_postprocess_features.py) applies a standard postprocessing routine to extracted features
- [recipe_standard_pipeline](https://github.com/mexca/mexca/blob/main/recipes/recipe_standard_pipeline.py) applies the standard MEXCA pipeline to a list of videos

## Components

The pipeline components are described [here](https://mexca.readthedocs.io/en/latest/components.html).

## Documentation

The documentation of mexca can be found on [Read the Docs](https://mexca.readthedocs.io/en/latest/index.html).

## Contributing

If you want to contribute to the development of mexca,
have a look at the [contribution guidelines](CONTRIBUTING.md).

## License

The code is licensed under the Apache 2.0 License. This means that mexca can be used, modified and redistributed for free, even for commercial purposes.

## Credits

Mexca is being developed by the [Netherlands eScience Center](https://www.esciencecenter.nl/) in collaboration with the [Hot Politics Lab](http://www.hotpolitics.eu/) at the University of Amsterdam.

This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [NLeSC/python-template](https://github.com/NLeSC/python-template).

[^1]: We explain the rationale for this setup in the [Docker](https://mexca.readthedocs.io/en/latest/docker.html) section.
