Metadata-Version: 2.4
Name: ilt-monotonic-align
Version: 1.2.1
Summary: Monotonic Alignment Search
Home-page: https://github.com/EveryVoiceTTS/monotonic_align
Maintainer: Eric Joanis
Maintainer-email: eric.joanis@nrc-cnrc.gc.ca
License: MIT
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: torch
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: maintainer
Dynamic: maintainer-email
Dynamic: requires-dist
Dynamic: summary

# EveryVoiceTTS fork of monotonic_align

We forked https://github.com/resemble-ai/monotonic_align in order to publish it to PyPI
so that it can be installed without requiring a clone:

```
pip install ilt-monotonic-align
```

# Original README file from [resemble-ai](https://github.com/resemble-ai/monotonic_align):

Adapted from the MAS in [Glow-TTS](https://github.com/jaywalnut310/glow-tts/tree/master/monotonic_align). I made it installable and added variants.

## Installation
```
pip install git+https://github.com/resemble-ai/monotonic_align.git
```
Installing `monotonic_align` doesn't require torch, but using ``monotonic_align`` will.
Please install PyTorch yourself, as its installation differ from system to system.


## How to Use
```python
# Suppose you have:
# 1. a probability matrix of size (batch_size=B, symbol_len=S, mel_lens=T)
#    NOTE: a similarity matrix (a higher score means better) or negative cost will do
#          but may have issues.
# 2. an array of symbol lengths `symbol_lens` of size (batch_size=B)
# 3. an array of mel-spectrogram lengths `mel_lens` of size (batch_size=B)

from monotonic_align import mask_from_lens, maximum_path
mask_ST = mask_from_lens(similarity, symbol_lens, mel_lens)
alignment = maximum_path(similarity, mask_ST)  # (B, S, T)

# NOTE:
# - If `mask` is not specified, the default mask is `True` for all elements.
# - You can specify `topology` if you want to use other variants of alignment algorithms.
```
