1{ buildPythonPackage
2, fetchurl
3, imageio
4, numpy
5, opencv3
6, pytest
7, scikitimage
8, scipy
9, shapely
10, six
11, stdenv
12, isPy38
13}:
14
15buildPythonPackage rec {
16 pname = "imgaug";
17 version = "0.3.0";
18
19 src = fetchurl {
20 url = "https://github.com/aleju/imgaug/archive/c3d99a420efc45652a1264920dc20378a54b1325.zip";
21 sha256 = "sha256:174nvhyhdn3vz0i34rqmkn26840j3mnfr55cvv5bdf9l4y9bbjq2";
22 };
23
24 postPatch = ''
25 substituteInPlace requirements.txt \
26 --replace "opencv-python-headless" ""
27 substituteInPlace setup.py \
28 --replace "opencv-python-headless" ""
29 substituteInPlace pytest.ini \
30 --replace "--xdoctest --xdoctest-global-exec=\"import imgaug as ia\nfrom imgaug import augmenters as iaa\"" ""
31 '';
32
33 propagatedBuildInputs = [
34 imageio
35 numpy
36 opencv3
37 scikitimage
38 scipy
39 shapely
40 six
41 ];
42
43 checkPhase = ''
44 pytest ./test
45 '';
46
47 checkInputs = [ opencv3 pytest ];
48
49 meta = with stdenv.lib; {
50 homepage = https://github.com/aleju/imgaug;
51 description = "Image augmentation for machine learning experiments";
52 license = licenses.mit;
53 maintainers = with maintainers; [ cmcdragonkai rakesh4g ];
54 platforms = platforms.linux;
55 broken = isPy38;
56 };
57}