2020-04-24 23:36:52 +00:00
|
|
|
{ buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, imageio
|
|
|
|
, imagecorruptions
|
|
|
|
, numpy
|
|
|
|
, opencv3
|
2021-06-28 23:13:55 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, scikitimage
|
|
|
|
, scipy
|
|
|
|
, shapely
|
|
|
|
, six
|
2021-02-05 17:12:51 +00:00
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "imgaug";
|
|
|
|
version = "0.4.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aleju";
|
|
|
|
repo = "imgaug";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "17hbxndxphk3bfnq35y805adrfa6gnm5x7grjxbwdw4kqmbbqzah";
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt \
|
|
|
|
--replace "opencv-python-headless" ""
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "opencv-python-headless" ""
|
|
|
|
substituteInPlace pytest.ini \
|
|
|
|
--replace "--xdoctest --xdoctest-global-exec=\"import imgaug as ia\nfrom imgaug import augmenters as iaa\"" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
imageio
|
|
|
|
imagecorruptions
|
|
|
|
numpy
|
|
|
|
opencv3
|
|
|
|
scikitimage
|
|
|
|
scipy
|
|
|
|
shapely
|
|
|
|
six
|
|
|
|
];
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
checkInputs = [
|
|
|
|
opencv3
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests are outdated
|
|
|
|
"test_quokka_segmentation_map"
|
|
|
|
"test_pool"
|
|
|
|
"test_avg_pool"
|
|
|
|
"test_max_pool"
|
|
|
|
"test_min_pool"
|
|
|
|
"est_median_pool"
|
|
|
|
"test_alpha_is_080"
|
|
|
|
"test_face_and_lines_at_half_visibility"
|
|
|
|
"test_polygon_fully_inside_image__no_rectangular_shape"
|
2021-12-06 16:07:01 +00:00
|
|
|
# flaky due to timing-based assertions
|
|
|
|
"test_imap_batches_output_buffer_size"
|
|
|
|
"test_imap_batches_unordered_output_buffer_size"
|
2021-06-28 23:13:55 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
|
|
|
# TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
|
|
|
|
"test/augmenters/test_pooling.py"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
pythonImportsCheck = [ "imgaug" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/aleju/imgaug";
|
|
|
|
description = "Image augmentation for machine learning experiments";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ cmcdragonkai rakesh4g ];
|
|
|
|
platforms = platforms.linux;
|
2022-09-09 14:08:57 +00:00
|
|
|
# Scikit-image 0.19 update broke API, see https://github.com/scikit-image/scikit-image/releases/tag/v0.19.0
|
|
|
|
# and https://github.com/scikit-image/scikit-image/issues/6093
|
|
|
|
broken = lib.versionAtLeast scikitimage.version "0.19";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|