MoisesDB

repository·main·Indexed 41 days ago

https://github.com/moises-ai/moises-db

A dataset and Python package (v0.0.3) designed for source separation research. It provides tracks and separated stems—such as vocals, bass, and drums—to evaluate separation algorithms via the MoisesDB and MoisesDBTrack classes.

Tokens
733
Snippets
4
Records
5
Agent score
2%

What's inside MoisesDB

  1. Verify MoisesDB dataset integrity

    main

    To ensure your downloaded moisesdb.zip is not corrupted, verify its hashes against the following values:

    MoisesDB Hashes:

    • MD5: 13cf74eda129c38b914a51ea79fb1778
    • SHA256: 4cde33ce416ac7c868cffcb60eb31f5c741ab7ae5601cbb9d99ed498b72c48c1

    Verification Commands:

    Linux/Mac:

    md5sum moisesdb.zip
    sha256sum moisesdb.zip

    Windows (PowerShell):

    Get-FileHash -Algorithm MD5 moisesdb.zip
    Get-FileHash -Algorithm SHA256 moisesdb.zip
  2. Use the MoisesDBTrack object to access audio and metadata

    main

    A MoisesDBTrack object represents a single track and provides access to its stems, mixture, and metadata. Stems and mixtures are computed on-the-fly.

    Audio Properties

    • track.stems: A dictionary where keys are stem names (e.g., 'vocals', 'bass') and values are nd.array objects.
    • track.audio: An nd.array representing the full mixture.

    Metadata Properties

    • track.id
    • track.provider
    • track.artist
    • track.name
    • track.genre
    • track.sources
    • track.bleedings
    • track.activity

    Saving Stems

    You can persist the on-the-fly computed stems to disk using the save_stems method.

    track = db[0]
    
    # Access audio
    stems = track.stems  # stems = {'vocals': ..., 'bass': ..., ...}
    mix = track.audio    # mixture = nd.array
    
    # Save stems to a specific directory
    path = './moises-db-stems/0'
    track.save_stems(path)
  3. Initialize the MoisesDB dataset object

    main

    Use the MoisesDB class to access tracks in the dataset. You can either rely on the MOISESDB_PATH environment variable or explicitly provide the data_path argument. You can also specify the sample_rate.

    The MoisesDB object supports standard Python indexing and length operations.

    from moisesdb.dataset import MoisesDB
    
    db = MoisesDB(
        data_path='./moisesdb',
        sample_rate=44100
    )
    
    n_songs = len(db)
    track = db[0]  # Returns a MoisesDBTrack object