14 buildPythonPackage rec {
15 pname = "piano-transcription-inference";
17 format = "setuptools";
20 inherit pname version;
21 hash = "sha256-nbhuSkXuWrekFxwdNHaspuag+3K1cKwq90IpATBpWPY=";
24 checkpoint = fetchurl {
25 name = "piano-transcription-inference.pth";
26 # The download url can be found in
27 # https://github.com/qiuqiangkong/piano_transcription_inference/blob/master/piano_transcription_inference/inference.py
28 url = "https://zenodo.org/record/4034264/files/CRNN_note_F1%3D0.9677_pedal_F1%3D0.9186.pth?download=1";
29 hash = "sha256-w/qXMHJb9Kdi8cFLyAzVmG6s2gGwJvWkolJc1geHYUE=";
32 propagatedBuildInputs = [
41 # Fix run against librosa 0.10.0
42 # https://github.com/qiuqiangkong/piano_transcription_inference/pull/14
44 url = "https://github.com/qiuqiangkong/piano_transcription_inference/commit/b2d448916be771cd228f709c23c474942008e3e8.patch";
45 hash = "sha256-8O4VtFij//k3fhcbMRz4J8Iz4AdOPLkuk3UTxuCSy8U=";
48 url = "https://github.com/qiuqiangkong/piano_transcription_inference/commit/61443632dc5ea69a072612b6fa3f7da62c96b72c.patch";
49 hash = "sha256-I9+Civ95BnPUX0WQhTU/pGQruF5ctIgkIdxCK+xO3PE=";
54 substituteInPlace piano_transcription_inference/inference.py --replace \
55 "checkpoint_path='{}/piano_transcription_inference_data/note_F1=0.9677_pedal_F1=0.9186.pth'.format(str(Path.home()))" \
56 "checkpoint_path='$out/share/checkpoint.pth'"
61 ln -s "${checkpoint}" "$out/share/checkpoint.pth"
64 # Project has no tests.
65 # In order to make pythonImportsCheck work, NUMBA_CACHE_DIR env var need to
66 # be set to a writable dir (https://github.com/numba/numba/issues/4032#issuecomment-488102702).
67 # pythonImportsCheck has no pre* hook, use checkPhase to wordaround that.
69 export NUMBA_CACHE_DIR="$(mktemp -d)"
71 pythonImportsCheck = [ "piano_transcription_inference" ];
74 description = "A piano transcription inference package";
75 homepage = "https://github.com/qiuqiangkong/piano_transcription_inference";
76 license = licenses.mit;
77 maintainers = with maintainers; [ azuwis ];