pyMV2H


NamepyMV2H JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/lucasmpaim/pyMV2H
SummaryA python implementation of MV2H metric
upload_time2024-04-10 01:54:00
maintainerNone
docs_urlNone
authorLucas Mrowskovsky Paim
requires_pythonNone
licenseUNLICENSE
keywords cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
![badge](https://github.com/lucasmpaim/pyMV2H/workflows/pyMV2H/badge.svg)
![PyPI license](https://img.shields.io/pypi/l/pyMV2H.svg)
![PyPI version fury.io](https://badge.fury.io/py/pyMV2H.svg)

# pyMV2H

A pure-python implementation of MV2H metric, the original repo can be found [here](https://github.com/apmcleod/MV2H).

For a more easily use with python frameworks, like PyTorch and Tensorflow we implement this repo.


# Usage

Using by shell:

```shell
pyMV2H
Usage:
  pyMV2H midi_converter -i <input_dir> -o <output_dir>
  pyMV2H compare_files -g <reference_file> -t <transcription_file> [-a] [-p]
  pyMV2H -h | --help
  pyMV2H --version
Options:
  -h --help                         Show this screen.
  --version                         Show version.
  -o --output                       The output file
  -t                                The transcription file
  -g                                The reference file
  -a                                Align both files
  -p                                Set the DTW insertion and deletion penalties
Examples:
  pyMV2H compare_files -g <reference_file> -t <transcription_file> -a -p 2.35
  pyMV2H midi_converter -i <midi_file> -o <output_dir>
Help:
  For help using this tool, please open an issue on the Github repository:
  https://github.com/lucasmpaim/pyMV2H
```

Using by python code:

```shell
pip install pyMV2H
```

Convert midi files:

```python
from pyMV2H.converter.midi_converter import MidiConverter as Converter
reference_midi_file = '<midi dir>'
reference_file = '<reference txt output>'

converter = Converter(file=reference_midi_file, output=reference_file)
converter.convert_file()
```

Compare files:

```python
from pyMV2H.utils.music import Music
from pyMV2H.metrics.mv2h import mv2h

reference_file = Music.from_file('<reference_file_dir>')
transcription_file = Music.from_file('<transcription_file_dir>')

print(mv2h(reference_file, transcription_file))
```

# Citation
Please, cite the original article:


```bibtex
@inproceedings{McLeod:18a,
  title={Evaluating automatic polyphonic music transcription},
  author={McLeod, Andrew and Steedman, Mark},
  booktitle={International Society for Music Information Retrieval Conference (ISMIR)},
  year={2018},
  pages={42--49}
}
```

# Important
For convenience at this point, python version doesn't include support for multi-tempo or chords, this repo is implemented for MIDI AMT's algorithms research, and the original repo doesn't extract this info from MIDI files. [ref.](https://github.com/apmcleod/MV2H/blame/master/README.md#L63)


## Next Step's

- [ ] Support for multi-tempo

- [ ] Reduce the number of dependencies

- [ ] Add support to chords

- [ ] MusicXML parser

- [x] Write unit tests

- [ ] Increase the number of Unit Tests

- [ ] Refactor code to be more pythonic

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/lucasmpaim/pyMV2H",
    "name": "pyMV2H",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "cli",
    "author": "Lucas Mrowskovsky Paim",
    "author_email": "lucas.mrowskovsky@pucpr.edu.br",
    "download_url": "https://files.pythonhosted.org/packages/fe/a2/090977a07ed5bfd6274cf5effaa208121e31a8ab9f163b622cb805613494/pyMV2H-1.1.0.tar.gz",
    "platform": null,
    "description": "\n![badge](https://github.com/lucasmpaim/pyMV2H/workflows/pyMV2H/badge.svg)\n![PyPI license](https://img.shields.io/pypi/l/pyMV2H.svg)\n![PyPI version fury.io](https://badge.fury.io/py/pyMV2H.svg)\n\n# pyMV2H\n\nA pure-python implementation of MV2H metric, the original repo can be found [here](https://github.com/apmcleod/MV2H).\n\nFor a more easily use with python frameworks, like PyTorch and Tensorflow we implement this repo.\n\n\n# Usage\n\nUsing by shell:\n\n```shell\npyMV2H\nUsage:\n  pyMV2H midi_converter -i <input_dir> -o <output_dir>\n  pyMV2H compare_files -g <reference_file> -t <transcription_file> [-a] [-p]\n  pyMV2H -h | --help\n  pyMV2H --version\nOptions:\n  -h --help                         Show this screen.\n  --version                         Show version.\n  -o --output                       The output file\n  -t                                The transcription file\n  -g                                The reference file\n  -a                                Align both files\n  -p                                Set the DTW insertion and deletion penalties\nExamples:\n  pyMV2H compare_files -g <reference_file> -t <transcription_file> -a -p 2.35\n  pyMV2H midi_converter -i <midi_file> -o <output_dir>\nHelp:\n  For help using this tool, please open an issue on the Github repository:\n  https://github.com/lucasmpaim/pyMV2H\n```\n\nUsing by python code:\n\n```shell\npip install pyMV2H\n```\n\nConvert midi files:\n\n```python\nfrom pyMV2H.converter.midi_converter import MidiConverter as Converter\nreference_midi_file = '<midi dir>'\nreference_file = '<reference txt output>'\n\nconverter = Converter(file=reference_midi_file, output=reference_file)\nconverter.convert_file()\n```\n\nCompare files:\n\n```python\nfrom pyMV2H.utils.music import Music\nfrom pyMV2H.metrics.mv2h import mv2h\n\nreference_file = Music.from_file('<reference_file_dir>')\ntranscription_file = Music.from_file('<transcription_file_dir>')\n\nprint(mv2h(reference_file, transcription_file))\n```\n\n# Citation\nPlease, cite the original article:\n\n\n```bibtex\n@inproceedings{McLeod:18a,\n  title={Evaluating automatic polyphonic music transcription},\n  author={McLeod, Andrew and Steedman, Mark},\n  booktitle={International Society for Music Information Retrieval Conference (ISMIR)},\n  year={2018},\n  pages={42--49}\n}\n```\n\n# Important\nFor convenience at this point, python version doesn't include support for multi-tempo or chords, this repo is implemented for MIDI AMT's algorithms research, and the original repo doesn't extract this info from MIDI files. [ref.](https://github.com/apmcleod/MV2H/blame/master/README.md#L63)\n\n\n## Next Step's\n\n- [ ] Support for multi-tempo\n\n- [ ] Reduce the number of dependencies\n\n- [ ] Add support to chords\n\n- [ ] MusicXML parser\n\n- [x] Write unit tests\n\n- [ ] Increase the number of Unit Tests\n\n- [ ] Refactor code to be more pythonic\n",
    "bugtrack_url": null,
    "license": "UNLICENSE",
    "summary": "A python implementation of MV2H metric",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://github.com/lucasmpaim/pyMV2H"
    },
    "split_keywords": [
        "cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a07f2d15be8a34d999e94c5b46a2cd6299f676ad34afccec607a3b9eb445d6a0",
                "md5": "705884eebe6eb0bd3e6534c72289dd6f",
                "sha256": "43a976e9b5cb5eaa9c02bb658cc92b16ddbdba00d48c3ff40bbcc39c091f6e60"
            },
            "downloads": -1,
            "filename": "pyMV2H-1.1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "705884eebe6eb0bd3e6534c72289dd6f",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 24424,
            "upload_time": "2024-04-10T01:53:57",
            "upload_time_iso_8601": "2024-04-10T01:53:57.959600Z",
            "url": "https://files.pythonhosted.org/packages/a0/7f/2d15be8a34d999e94c5b46a2cd6299f676ad34afccec607a3b9eb445d6a0/pyMV2H-1.1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fea2090977a07ed5bfd6274cf5effaa208121e31a8ab9f163b622cb805613494",
                "md5": "82ed4969f8cbc65f26dcb55136d63502",
                "sha256": "7cf47dd3e36ef7bf852121fe850869b2c7430024dbdb6d1150b51aa60cd911af"
            },
            "downloads": -1,
            "filename": "pyMV2H-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "82ed4969f8cbc65f26dcb55136d63502",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 118559,
            "upload_time": "2024-04-10T01:54:00",
            "upload_time_iso_8601": "2024-04-10T01:54:00.434829Z",
            "url": "https://files.pythonhosted.org/packages/fe/a2/090977a07ed5bfd6274cf5effaa208121e31a8ab9f163b622cb805613494/pyMV2H-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-10 01:54:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "lucasmpaim",
    "github_project": "pyMV2H",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pymv2h"
}
        
Elapsed time: 0.22315s