A lightweight yet powerful audio-to-MIDI converter with pitch bend detection
Python audiolightweightmachine-learningmidimusicpitch-detectionpolyphonicpythontranscriptiontypescript
Pin tf<2.16 and resolve in a future pr
David Rubinsteinef94d1a15ae4
diff --git a/pyproject.toml b/pyproject.tomlindex e23e7a0..2469837 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -23,10 +23,10 @@ dependencies = ["numpy>=1.18","onnxruntime; platform_system == 'Windows' and python_version < '3.11'","pretty_midi>=0.2.9",- "resampy>=0.2.2",+ "resampy>=0.2.2,<0.4.3","scikit-learn","scipy>=1.4.1",- "tensorflow>=2.4.1; platform_system != 'Darwin' and python_version >= '3.11'",+ "tensorflow>=2.4.1,<2.16; platform_system != 'Darwin' and python_version >= '3.11'","tensorflow-macos>=2.4.1; platform_system == 'Darwin' and python_version >= '3.11'","tflite-runtime; platform_system == 'Linux' and python_version < '3.11'","typing_extensions",@@ -56,8 +56,8 @@ test = ["pytest-mock",]tf = [- "tensorflow>=2.4.1; platform_system != 'Darwin'",- "tensorflow-macos>=2.4.1; platform_system == 'Darwin' and python_version > '3.7'",+ "tensorflow>=2.4.1,<2.16; platform_system != 'Darwin'",+ "tensorflow-macos>=2.4.1,<2.16; platform_system == 'Darwin' and python_version > '3.7'",]coreml = ["coremltools"]onnx = ["onnxruntime"]diff --git a/tests/resources/vocadito_10/model_output.npz b/tests/resources/vocadito_10/model_output.npzindex 8719f8a..9b2a404 100644Binary files a/tests/resources/vocadito_10/model_output.npz and b/tests/resources/vocadito_10/model_output.npz differdiff --git a/tests/resources/vocadito_10/note_events.npz b/tests/resources/vocadito_10/note_events.npzindex ffd860c..a5e7d51 100644Binary files a/tests/resources/vocadito_10/note_events.npz and b/tests/resources/vocadito_10/note_events.npz differdiff --git a/tests/test_inference.py b/tests/test_inference.pyindex 1934239..8966585 100644--- a/tests/test_inference.py+++ b/tests/test_inference.py@@ -55,12 +55,11 @@ def test_predict() -> None:assert all(note_pitch_max)assert isinstance(note_events, list)- expected_model_output = np.load("tests/resources/vocadito_10/model_output.npz")+ expected_model_output = np.load("tests/resources/vocadito_10/model_output.npz", allow_pickle=True)["arr_0"].item()for k in expected_model_output.keys():np.testing.assert_allclose(expected_model_output[k], model_output[k], atol=1e-4, rtol=0)- expected_note_events = np.load("tests/resources/vocadito_10/note_events.npz", allow_pickle=True)- expected_note_events = expected_note_events.get("arr_0")+ expected_note_events = np.load("tests/resources/vocadito_10/note_events.npz", allow_pickle=True)["arr_0"]assert len(expected_note_events) == len(note_events)for expected, calculated in zip(expected_note_events, note_events):diff --git a/tox.ini b/tox.iniindex 24a1df5..38a9380 100644--- a/tox.ini+++ b/tox.ini@@ -11,7 +11,7 @@ requires =[testenv]deps = -e .[test]commands =- pytest tests --ignore tests/test_nn.py -s {posargs}+ pytest tests --ignore tests/test_nn.py {posargs}setenv =SOURCE = {toxinidir}/basic_pitchTEST_SOURCE = {toxinidir}/tests