From 450b8ffd5ad42c506d26207dfe2aab7aff27cfeb Mon Sep 17 00:00:00 2001 From: marypilataki Date: Wed, 4 Dec 2024 12:19:01 +1300 Subject: [PATCH] update readme --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 00acb6e..2f3c6d9 100644 --- a/README.md +++ b/README.md @@ -105,13 +105,18 @@ basic-pitch --help **predict()** -Import `basic-pitch` into your own Python code and run the [`predict`](basic_pitch/inference.py) functions directly, providing an `` and returning the model's prediction results: +Import `basic-pitch` into your own Python code and run the [`predict`](basic_pitch/inference.py) functions directly, providing an `` or an `` and returning the model's prediction results: ```python from basic_pitch.inference import predict -from basic_pitch import ICASSP_2022_MODEL_PATH +# get model predictions given an audio file model_output, midi_data, note_events = predict() + +# or alternatively, provide an array of samples +audio_array, sample_rate = librosa.load(, mono=True, duration=10.0, offset=5.0) +model_output, midi_data, note_events = predict(audio_array, sample_rate) + ``` - `` & `` (*float*s) set the maximum and minimum allowed note frequency, in Hz, returned by the model. Pitch events with frequencies outside of this range will be excluded from the prediction results.