0d9fc34957
GitOrigin-RevId: 5ed481943351e9fd354aeb557679624224de38d5
64 lines
1.3 KiB
Nix
64 lines
1.3 KiB
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, pythonOlder
|
|
, ninja
|
|
, ignite
|
|
, numpy
|
|
, pybind11
|
|
, torch
|
|
, which
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "monai";
|
|
version = "1.1.0";
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "Project-MONAI";
|
|
repo = "MONAI";
|
|
rev = "refs/tags/${version}";
|
|
hash = "sha256-XTjZhynIiFtFjJSW6rRAnpErZvf6QHkuK4e2L6l3naM=";
|
|
};
|
|
|
|
# Ninja is not detected by setuptools for some reason even though it's present:
|
|
postPatch = ''
|
|
substituteInPlace "setup.cfg" --replace " ninja" ""
|
|
'';
|
|
|
|
preBuild = ''
|
|
export MAX_JOBS=$NIX_BUILD_CORES;
|
|
'';
|
|
|
|
nativeBuildInputs = [ ninja which ];
|
|
buildInputs = [ pybind11 ];
|
|
propagatedBuildInputs = [ numpy torch ignite ];
|
|
|
|
BUILD_MONAI = 1;
|
|
|
|
doCheck = false; # takes too long; numerous dependencies, some not in Nixpkgs
|
|
|
|
pythonImportsCheck = [
|
|
"monai"
|
|
"monai.apps"
|
|
"monai.data"
|
|
"monai.engines"
|
|
"monai.handlers"
|
|
"monai.inferers"
|
|
"monai.losses"
|
|
"monai.metrics"
|
|
"monai.optimizers"
|
|
"monai.networks"
|
|
"monai.transforms"
|
|
"monai.utils"
|
|
"monai.visualize"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Pytorch framework (based on Ignite) for deep learning in medical imaging";
|
|
homepage = "https://github.com/Project-MONAI/MONAI";
|
|
license = licenses.asl20;
|
|
maintainers = [ maintainers.bcdarwin ];
|
|
};
|
|
}
|