diff --git a/pkgs/development/python-modules/grad-cam/default.nix b/pkgs/development/python-modules/grad-cam/default.nix index e5fd9a439c68..a2ab800fe0fa 100644 --- a/pkgs/development/python-modules/grad-cam/default.nix +++ b/pkgs/development/python-modules/grad-cam/default.nix @@ -1,11 +1,11 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, setuptools, matplotlib, numpy, - opencv-python, + opencv-python-headless, pillow, scikit-learn, torch, @@ -19,11 +19,19 @@ buildPythonPackage rec { version = "1.5.7"; pyproject = true; - src = fetchPypi { - inherit pname version; - hash = "sha256-9r4G+CZnei6SLDh535vjlEsUppZD2A577Jrfsm9rXkI="; + src = fetchFromGitHub { + owner = "jacobgil"; + repo = "pytorch-grad-cam"; + rev = "704393448a7b0c620ee2c2b9597723f1d7f17b3d"; + hash = "sha256-qNmIl+kERDiJeig6A9UjnwUd7VaO91QqhwszaszLAow="; }; + # Runtime sources match the 1.5.7 sdist, but GitHub's setup.py still declares 1.5.5. + postPatch = '' + substituteInPlace setup.py \ + --replace-fail "version='1.5.5'" "version='${version}'" + ''; + nativeBuildInputs = [ ]; @@ -38,7 +46,7 @@ buildPythonPackage rec { dependencies = [ matplotlib numpy - opencv-python + opencv-python-headless pillow scikit-learn torchvision