Coder Social home page Coder Social logo

monotonic_align's Introduction

Adapted from the MAS in Glow-TTS. 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

# 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.

monotonic_align's People

Contributors

jeremycchsu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

monotonic_align's Issues

pkg_resources.DistributionNotFound

Traceback (most recent call last):
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/qwork4/twu/qwork4/twu/monotonic_align-master/monotonic_align/init.py", line 3, in
version = pkg_resources.get_distribution('monotonic_align').version
File "/qwork4/twu/miniconda/envs/dur/lib/python3.6/site-packages/pkg_resources/init.py", line 471, in get_distribution
dist = get_provider(dist)
File "/qwork4/twu/miniconda/envs/dur/lib/python3.6/site-packages/pkg_resources/init.py", line 347, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "/qwork4/twu/miniconda/envs/dur/lib/python3.6/site-packages/pkg_resources/init.py", line 891, in require
needed = self.resolve(parse_requirements(requirements))
File "/qwork4/twu/miniconda/envs/dur/lib/python3.6/site-packages/pkg_resources/init.py", line 777, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'monotonic_align' distribution was not found and is required by the application

Have you encountered this situation????

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.