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