Loading pkgs/applications/audio/pianotrans/default.nix 0 → 100644 +38 −0 Original line number Diff line number Diff line { lib , fetchFromGitHub , python3 , ffmpeg }: python3.pkgs.buildPythonApplication rec { pname = "pianotrans"; version = "1.0"; format = "setuptools"; src = fetchFromGitHub { owner = "azuwis"; repo = pname; rev = "v${version}"; hash = "sha256-6Otup1Yat1dBZdSoR4lDfpytUQ2RbDXC6ieo835Nw+U="; }; propagatedBuildInputs = with python3.pkgs; [ piano-transcription-inference torch tkinter ]; # Project has no tests doCheck = false; makeWrapperArgs = [ ''--prefix PATH : "${lib.makeBinPath [ ffmpeg ]}"'' ]; meta = with lib; { description = "Simple GUI for ByteDance's Piano Transcription with Pedals"; homepage = "https://github.com/azuwis/pianotrans"; license = licenses.mit; maintainers = with maintainers; [ azuwis ]; }; } pkgs/development/python-modules/piano-transcription-inference/default.nix 0 → 100644 +75 −0 Original line number Diff line number Diff line { stdenv , lib , buildPythonPackage , fetchPypi , fetchpatch , fetchurl , librosa , matplotlib , mido , torch , torchlibrosa }: buildPythonPackage rec { pname = "piano-transcription-inference"; version = "0.0.5"; format = "setuptools"; src = fetchPypi { inherit pname version; hash = "sha256-nbhuSkXuWrekFxwdNHaspuag+3K1cKwq90IpATBpWPY="; }; checkpoint = fetchurl { name = "piano-transcription-inference.pth"; # The download url can be found in # https://github.com/qiuqiangkong/piano_transcription_inference/blob/master/piano_transcription_inference/inference.py url = "https://zenodo.org/record/4034264/files/CRNN_note_F1%3D0.9677_pedal_F1%3D0.9186.pth?download=1"; hash = "sha256-w/qXMHJb9Kdi8cFLyAzVmG6s2gGwJvWkolJc1geHYUE="; }; propagatedBuildInputs = [ librosa matplotlib mido torch torchlibrosa ]; patches = [ # Fix run against librosa 0.9.0 # https://github.com/qiuqiangkong/piano_transcription_inference/pull/10 (fetchpatch { url = "https://github.com/qiuqiangkong/piano_transcription_inference/commit/b2d448916be771cd228f709c23c474942008e3e8.patch"; hash = "sha256-8O4VtFij//k3fhcbMRz4J8Iz4AdOPLkuk3UTxuCSy8U="; }) ]; postPatch = '' substituteInPlace piano_transcription_inference/inference.py --replace \ "checkpoint_path='{}/piano_transcription_inference_data/note_F1=0.9677_pedal_F1=0.9186.pth'.format(str(Path.home()))" \ "checkpoint_path='$out/share/checkpoint.pth'" ''; postInstall = '' mkdir "$out/share" ln -s "${checkpoint}" "$out/share/checkpoint.pth" ''; # Project has no tests. # In order to make pythonImportsCheck work, NUMBA_CACHE_DIR env var need to # be set to a writable dir (https://github.com/numba/numba/issues/4032#issuecomment-488102702). # pythonImportsCheck has no pre* hook, use checkPhase to wordaround that. checkPhase = '' export NUMBA_CACHE_DIR="$(mktemp -d)" ''; pythonImportsCheck = [ "piano_transcription_inference" ]; meta = with lib; { description = "A piano transcription inference package"; homepage = "https://github.com/qiuqiangkong/piano_transcription_inference"; license = licenses.mit; maintainers = with maintainers; [ azuwis ]; }; } pkgs/development/python-modules/torchlibrosa/default.nix 0 → 100644 +50 −0 Original line number Diff line number Diff line { stdenv , lib , buildPythonPackage , fetchPypi , fetchpatch , librosa , numpy , torch }: buildPythonPackage rec { pname = "torchlibrosa"; version = "0.0.9"; format = "setuptools"; src = fetchPypi { inherit pname version; hash = "sha256-+LzejKvLlJIIwWm9rYPCWQDSueIwnG5gbkwNE+wbv0A="; }; propagatedBuildInputs = [ librosa numpy torch ]; patches = [ # Fix run against librosa 0.9.0, https://github.com/qiuqiangkong/torchlibrosa/pull/8 (fetchpatch { url = "https://github.com/qiuqiangkong/torchlibrosa/commit/eec7e7559a47d0ef0017322aee29a31dad0572d5.patch"; hash = "sha256-c1x3MA14Plm7+lVuqiuLWgSY6FW615qnKbcWAfbrcas="; }) ]; # Project has no tests. # In order to make pythonImportsCheck work, NUMBA_CACHE_DIR env var need to # be set to a writable dir (https://github.com/numba/numba/issues/4032#issuecomment-488102702). # pythonImportsCheck has no pre* hook, use checkPhase to workaround that. checkPhase = '' export NUMBA_CACHE_DIR="$(mktemp -d)" ''; pythonImportsCheck = [ "torchlibrosa" ]; meta = with lib; { description = "PyTorch implemention of part of librosa functions"; homepage = "https://github.com/qiuqiangkong/torchlibrosa"; license = licenses.mit; maintainers = with maintainers; [ azuwis ]; }; } pkgs/top-level/all-packages.nix +2 −0 Original line number Diff line number Diff line Loading @@ -32088,6 +32088,8 @@ with pkgs; pianoteq = callPackage ../applications/audio/pianoteq { }; pianotrans = callPackage ../applications/audio/pianotrans { }; picard = callPackage ../applications/audio/picard { }; picocom = callPackage ../tools/misc/picocom { pkgs/top-level/python-packages.nix +4 −0 Original line number Diff line number Diff line Loading @@ -7066,6 +7066,8 @@ self: super: with self; { pi1wire = callPackage ../development/python-modules/pi1wire { }; piano-transcription-inference = callPackage ../development/python-modules/piano-transcription-inference { }; piccata = callPackage ../development/python-modules/piccata { }; pick = callPackage ../development/python-modules/pick { }; Loading Loading @@ -11528,6 +11530,8 @@ self: super: with self; { torchinfo = callPackage ../development/python-modules/torchinfo { }; torchlibrosa = callPackage ../development/python-modules/torchlibrosa { }; torchvision = callPackage ../development/python-modules/torchvision { }; torchvision-bin = callPackage ../development/python-modules/torchvision/bin.nix { }; Loading Loading
pkgs/applications/audio/pianotrans/default.nix 0 → 100644 +38 −0 Original line number Diff line number Diff line { lib , fetchFromGitHub , python3 , ffmpeg }: python3.pkgs.buildPythonApplication rec { pname = "pianotrans"; version = "1.0"; format = "setuptools"; src = fetchFromGitHub { owner = "azuwis"; repo = pname; rev = "v${version}"; hash = "sha256-6Otup1Yat1dBZdSoR4lDfpytUQ2RbDXC6ieo835Nw+U="; }; propagatedBuildInputs = with python3.pkgs; [ piano-transcription-inference torch tkinter ]; # Project has no tests doCheck = false; makeWrapperArgs = [ ''--prefix PATH : "${lib.makeBinPath [ ffmpeg ]}"'' ]; meta = with lib; { description = "Simple GUI for ByteDance's Piano Transcription with Pedals"; homepage = "https://github.com/azuwis/pianotrans"; license = licenses.mit; maintainers = with maintainers; [ azuwis ]; }; }
pkgs/development/python-modules/piano-transcription-inference/default.nix 0 → 100644 +75 −0 Original line number Diff line number Diff line { stdenv , lib , buildPythonPackage , fetchPypi , fetchpatch , fetchurl , librosa , matplotlib , mido , torch , torchlibrosa }: buildPythonPackage rec { pname = "piano-transcription-inference"; version = "0.0.5"; format = "setuptools"; src = fetchPypi { inherit pname version; hash = "sha256-nbhuSkXuWrekFxwdNHaspuag+3K1cKwq90IpATBpWPY="; }; checkpoint = fetchurl { name = "piano-transcription-inference.pth"; # The download url can be found in # https://github.com/qiuqiangkong/piano_transcription_inference/blob/master/piano_transcription_inference/inference.py url = "https://zenodo.org/record/4034264/files/CRNN_note_F1%3D0.9677_pedal_F1%3D0.9186.pth?download=1"; hash = "sha256-w/qXMHJb9Kdi8cFLyAzVmG6s2gGwJvWkolJc1geHYUE="; }; propagatedBuildInputs = [ librosa matplotlib mido torch torchlibrosa ]; patches = [ # Fix run against librosa 0.9.0 # https://github.com/qiuqiangkong/piano_transcription_inference/pull/10 (fetchpatch { url = "https://github.com/qiuqiangkong/piano_transcription_inference/commit/b2d448916be771cd228f709c23c474942008e3e8.patch"; hash = "sha256-8O4VtFij//k3fhcbMRz4J8Iz4AdOPLkuk3UTxuCSy8U="; }) ]; postPatch = '' substituteInPlace piano_transcription_inference/inference.py --replace \ "checkpoint_path='{}/piano_transcription_inference_data/note_F1=0.9677_pedal_F1=0.9186.pth'.format(str(Path.home()))" \ "checkpoint_path='$out/share/checkpoint.pth'" ''; postInstall = '' mkdir "$out/share" ln -s "${checkpoint}" "$out/share/checkpoint.pth" ''; # Project has no tests. # In order to make pythonImportsCheck work, NUMBA_CACHE_DIR env var need to # be set to a writable dir (https://github.com/numba/numba/issues/4032#issuecomment-488102702). # pythonImportsCheck has no pre* hook, use checkPhase to wordaround that. checkPhase = '' export NUMBA_CACHE_DIR="$(mktemp -d)" ''; pythonImportsCheck = [ "piano_transcription_inference" ]; meta = with lib; { description = "A piano transcription inference package"; homepage = "https://github.com/qiuqiangkong/piano_transcription_inference"; license = licenses.mit; maintainers = with maintainers; [ azuwis ]; }; }
pkgs/development/python-modules/torchlibrosa/default.nix 0 → 100644 +50 −0 Original line number Diff line number Diff line { stdenv , lib , buildPythonPackage , fetchPypi , fetchpatch , librosa , numpy , torch }: buildPythonPackage rec { pname = "torchlibrosa"; version = "0.0.9"; format = "setuptools"; src = fetchPypi { inherit pname version; hash = "sha256-+LzejKvLlJIIwWm9rYPCWQDSueIwnG5gbkwNE+wbv0A="; }; propagatedBuildInputs = [ librosa numpy torch ]; patches = [ # Fix run against librosa 0.9.0, https://github.com/qiuqiangkong/torchlibrosa/pull/8 (fetchpatch { url = "https://github.com/qiuqiangkong/torchlibrosa/commit/eec7e7559a47d0ef0017322aee29a31dad0572d5.patch"; hash = "sha256-c1x3MA14Plm7+lVuqiuLWgSY6FW615qnKbcWAfbrcas="; }) ]; # Project has no tests. # In order to make pythonImportsCheck work, NUMBA_CACHE_DIR env var need to # be set to a writable dir (https://github.com/numba/numba/issues/4032#issuecomment-488102702). # pythonImportsCheck has no pre* hook, use checkPhase to workaround that. checkPhase = '' export NUMBA_CACHE_DIR="$(mktemp -d)" ''; pythonImportsCheck = [ "torchlibrosa" ]; meta = with lib; { description = "PyTorch implemention of part of librosa functions"; homepage = "https://github.com/qiuqiangkong/torchlibrosa"; license = licenses.mit; maintainers = with maintainers; [ azuwis ]; }; }
pkgs/top-level/all-packages.nix +2 −0 Original line number Diff line number Diff line Loading @@ -32088,6 +32088,8 @@ with pkgs; pianoteq = callPackage ../applications/audio/pianoteq { }; pianotrans = callPackage ../applications/audio/pianotrans { }; picard = callPackage ../applications/audio/picard { }; picocom = callPackage ../tools/misc/picocom {
pkgs/top-level/python-packages.nix +4 −0 Original line number Diff line number Diff line Loading @@ -7066,6 +7066,8 @@ self: super: with self; { pi1wire = callPackage ../development/python-modules/pi1wire { }; piano-transcription-inference = callPackage ../development/python-modules/piano-transcription-inference { }; piccata = callPackage ../development/python-modules/piccata { }; pick = callPackage ../development/python-modules/pick { }; Loading Loading @@ -11528,6 +11530,8 @@ self: super: with self; { torchinfo = callPackage ../development/python-modules/torchinfo { }; torchlibrosa = callPackage ../development/python-modules/torchlibrosa { }; torchvision = callPackage ../development/python-modules/torchvision { }; torchvision-bin = callPackage ../development/python-modules/torchvision/bin.nix { }; Loading