Files
nixpkgs/pkgs/development/python-modules/grad-cam/default.nix
T
Robert Schütz 1a04744f74 treewide: remove superfluous disabled
There is no need to disable Python packages for Python versions that are
no longer in Nixpkgs.
This change was generated using the following script:

    pattern='^\s*disabled\s*=\s*pythonOlder\s*"3\.\([0-9]\|10\)"\s*;\s*$'
    for f in $(find -name '*.nix'); do
        grep -q "$pattern" "$f" || continue
        sed -i "/$pattern/d" "$f"
        if [ $(grep -c pythonOlder "$f") == 1 ]; then
            sed -i '/^\s*pythonOlder,\s*$/d' "$f"
        fi
        nixfmt "$f"
    done
2026-01-11 09:34:20 -08:00

71 lines
1.3 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
setuptools,
matplotlib,
numpy,
opencv-python,
pillow,
scikit-learn,
torch,
torchvision,
ttach,
tqdm,
}:
buildPythonPackage rec {
pname = "grad-cam";
version = "1.5.5";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-aQxDPSJtNcicnrFwRi2yBJCcsGs5xzgeaICkm2/DcBU=";
};
nativeBuildInputs = [
];
pythonRelaxDeps = [
"torchvision"
];
build-system = [
setuptools
];
dependencies = [
matplotlib
numpy
opencv-python
pillow
scikit-learn
torchvision
ttach
tqdm
];
# Let the user bring their own instance (as with torchmetrics)
buildInputs = [ torch ];
doCheck = false; # every nontrivial test tries to download a pretrained model
pythonImportsCheck = [
"pytorch_grad_cam"
"pytorch_grad_cam.metrics"
"pytorch_grad_cam.metrics.cam_mult_image"
"pytorch_grad_cam.metrics.road"
"pytorch_grad_cam.utils"
"pytorch_grad_cam.utils.image"
"pytorch_grad_cam.utils.model_targets"
];
meta = {
description = "Advanced AI explainability for computer vision";
homepage = "https://jacobgil.github.io/pytorch-gradcam-book";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ bcdarwin ];
};
}