Giter VIP home page Giter VIP logo

labbu's Introduction

labbu 🏷️

"labbu" is a tool created to assist in contextual editing of phonetic "lab" files. These files are common place in a lot of SVS tools. (DiffSinger, NNSVS, etc)

Quick Usage

To quickly and easily convert MFA TextGrids to Labs you can use this notebook: Open In Colab
Please Note: Currenly, I have only implemented support for English and Japanese in the notebook, but by editing code you can do it with any.

Basic Usage

Currently, labbu must be installed manually, and the only dependency is mytextgrid, so make sure that's installed first! Simply download "labbu.py" and place it in the folder you'll be using other code out of. Below is an example of a script that will replace all label indexes with [SP] as the phoneme with [slay], but only if the next phoneme is [aa]. All information about the lab is saved in the object, which I recommend calling "labu" for the sake of consistency.

import labbu

labu = labbu.labbu()
labu.load_lab({file_path_to_label})

for i in range(len(labu.get_length())): #check in each index of the lab file
  if labu.curr_phone(i) == 'SP' and labu.next_phone(i) == 'aa':
    labu.change_phone(i, 'slay')

labu.export_lab({output_path})

Further documentation and examples will come as labbu is developed.

Label Checker

I've created a label checker for labbu! This script will check for undefined phonemes in labels, as well as lables that are under 51000 units, or about 0.051 seconds (idk why I picked that number), which can cause issues when training. To run it, you'll need labbu installed with the proper depencies, and also will need to install click.

pip install click

To run it, simply type run this command:

python check_labels.py -p {path_to_labels}

To check different languages, you can use the -l argument. The current distribution of labbu supports japanese, millefeuille (you can find Millefeuille here and default, which includes Japanese and standard English Arpabet.

If you'd like to use a custom phoneme set, you can define one. Reference this file to create your own custom language set. Then, enter the command like this:

python check_labels.py -p {path_to_labels} -l custom -cl {path_to_custom_lang.yaml}

Citations

Loading from Praat TextGrid was referenced from Overdramatic's "text2lab" (Thank you!)

labbu's People

Contributors

spicytigermeat avatar rokujyushi avatar

Stargazers

 avatar HAI-D avatar  avatar

Watchers

 avatar

Forkers

rokujyushi

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.