1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6
7 # build-system
8 setuptools,
9
10 # dependencies
11 fsspec,
12 imagehash,
13 matplotlib,
14 numpy,
15 pandas,
16 pillow,
17 tabulate,
18 tqdm,
19
20 # tests
21 datasets,
22 psutil,
23 pytestCheckHook,
24 torchvision,
25}:
26
27buildPythonPackage rec {
28 pname = "cleanvision";
29 version = "0.3.6";
30 pyproject = true;
31
32 src = fetchFromGitHub {
33 owner = "cleanlab";
34 repo = "cleanvision";
35 tag = "v${version}";
36 hash = "sha256-QAydDqLJx/jYKXqxRUElTdM5dOFA6nZag8rNAjPZjRg=";
37 };
38
39 build-system = [ setuptools ];
40
41 dependencies = [
42 fsspec
43 imagehash
44 matplotlib
45 numpy
46 pandas
47 pillow
48 tabulate
49 tqdm
50 ];
51
52 pythonImportsCheck = [ "cleanvision" ];
53
54 nativeCheckInputs = [
55 datasets
56 psutil
57 pytestCheckHook
58 torchvision
59 ];
60
61 preCheck = ''
62 export HOME=$(mktemp -d)
63 '';
64
65 disabledTests = [
66 # Requires accessing s3 (online)
67 "test_s3_dataset"
68 ];
69
70 meta = {
71 description = "Automatically find issues in image datasets and practice data-centric computer vision";
72 homepage = "https://github.com/cleanlab/cleanvision";
73 changelog = "https://github.com/cleanlab/cleanvision/releases/tag/v${version}";
74 license = lib.licenses.agpl3Only;
75 maintainers = with lib.maintainers; [ GaetanLepage ];
76 # Fatal Python error: Aborted
77 broken = stdenv.hostPlatform.isDarwin;
78 };
79}