2020-04-24 23:36:52 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, cython
|
|
|
|
, fetchFromGitHub
|
2021-12-19 01:06:50 +00:00
|
|
|
, fetchpatch
|
2020-04-24 23:36:52 +00:00
|
|
|
, h5py
|
|
|
|
, imgaug
|
|
|
|
, ipython
|
2021-12-19 01:06:50 +00:00
|
|
|
, keras
|
2020-04-24 23:36:52 +00:00
|
|
|
, lib
|
|
|
|
, matplotlib
|
|
|
|
, numpy
|
|
|
|
, opencv3
|
|
|
|
, pillow
|
|
|
|
, scikitimage
|
|
|
|
, scipy
|
2021-12-06 16:07:01 +00:00
|
|
|
, tensorflow
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "mask-rcnn";
|
|
|
|
version = "2.1";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "matterport";
|
|
|
|
repo = "Mask_RCNN";
|
|
|
|
rev = "3deaec5d902d16e1daf56b62d5971d428dc920bc";
|
|
|
|
sha256 = "13s3q9yh2q9m9vyksd269mww3bni4q2w7q5l419q70ca075qp8zp";
|
|
|
|
};
|
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
patches = [
|
|
|
|
# Fix for TF2:
|
|
|
|
# https://github.com/matterport/Mask_RCNN/issues/2734
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/BupyeongHealer/Mask_RCNN_tf_2.x/commit/7957839fe2b248f2f22c7e991ead12068ddc6cfc.diff";
|
|
|
|
excludes = [ "mrcnn/model.py" ];
|
|
|
|
sha256 = "sha256-70BGrx6X1uJDA2025f0YTlreT2uB3n35yIzuhf+ypVc=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
# Fix for recent Keras
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace mrcnn/model.py \
|
|
|
|
--replace "KE." "KL."
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ cython ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
h5py
|
|
|
|
imgaug
|
|
|
|
ipython
|
2021-12-19 01:06:50 +00:00
|
|
|
keras
|
2020-04-24 23:36:52 +00:00
|
|
|
matplotlib
|
|
|
|
numpy
|
|
|
|
opencv3
|
|
|
|
pillow
|
|
|
|
scikitimage
|
|
|
|
scipy
|
2021-12-06 16:07:01 +00:00
|
|
|
tensorflow
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow";
|
|
|
|
homepage = "https://github.com/matterport/Mask_RCNN";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ rakesh4g ];
|
|
|
|
};
|
|
|
|
}
|