A lightweight yet powerful audio-to-MIDI converter with pitch bend detection
Python audiolightweightmachine-learningmidimusicpitch-detectionpolyphonicpythontranscriptiontypescript
use cuda with onnx if available
Nathan Rawb7e349dd132a
diff --git a/basic_pitch/inference.py b/basic_pitch/inference.pyindex 2544cd9..25b062c 100644--- a/basic_pitch/inference.py+++ b/basic_pitch/inference.py@@ -129,7 +129,10 @@ class Model:present.append("ONNX")try:self.model_type = Model.MODEL_TYPES.ONNX- self.model = ort.InferenceSession(str(model_path), providers=["CPUExecutionProvider"])+ providers = ["CPUExecutionProvider"]+ if "CUDAExecutionProvider" in ort.get_available_providers():+ providers.insert(0, "CUDAExecutionProvider")+ self.model = ort.InferenceSession(str(model_path), providers=providers)returnexcept Exception as e:if str(model_path).endswith(".onnx"):