1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6
7 # build-system
8 setuptools,
9
10 # dependencies
11 albucore,
12 eval-type-backport,
13 numpy,
14 opencv4,
15 pydantic,
16 pyyaml,
17 scikit-image,
18 scikit-learn,
19 scipy,
20 typing-extensions,
21
22 deepdiff,
23 pytestCheckHook,
24 pytest-mock,
25 torch,
26 torchvision,
27}:
28
29buildPythonPackage rec {
30 pname = "albumentations";
31 version = "1.4.11";
32 pyproject = true;
33
34 disabled = pythonOlder "3.8";
35
36 src = fetchFromGitHub {
37 owner = "albumentations-team";
38 repo = "albumentations";
39 rev = "refs/tags/${version}";
40 hash = "sha256-1070V9+EZ4qrhxmbMyvTbu89pLoonrn0Peb8nwp2lwA=";
41 };
42
43 pythonRemoveDeps = [ "opencv-python" ];
44
45 build-system = [ setuptools ];
46
47 dependencies = [
48 albucore
49 eval-type-backport
50 numpy
51 opencv4
52 pydantic
53 pyyaml
54 scikit-image
55 scikit-learn
56 ];
57
58 nativeCheckInputs = [
59 deepdiff
60 pytestCheckHook
61 pytest-mock
62 torch
63 torchvision
64 ];
65
66 disabledTests = [
67 # this test hangs up
68 "test_transforms"
69 ];
70
71 pythonImportsCheck = [ "albumentations" ];
72
73 meta = {
74 description = "Fast image augmentation library and easy to use wrapper around other libraries";
75 homepage = "https://github.com/albumentations-team/albumentations";
76 changelog = "https://github.com/albumentations-team/albumentations/releases/tag/${version}";
77 license = lib.licenses.mit;
78 maintainers = with lib.maintainers; [ natsukium ];
79 };
80}