saunafs: 4.6.0 -> 4.7.0 (#379649)
[NixPkgs.git] / pkgs / development / python-modules / compressai / default.nix
bloba3b4e3238d79ff10340ab8d7d31025f0b5526c8f
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
6   # build-system
7   pybind11,
8   setuptools,
10   # dependencies
11   einops,
12   numpy,
13   matplotlib,
14   pandas,
15   pytorch-msssim,
16   scipy,
17   torch,
18   torch-geometric,
19   torchvision,
21   # optional-dependencies
22   ipywidgets,
23   jupyter,
25   # tests
26   plotly,
27   pytestCheckHook,
30 buildPythonPackage rec {
31   pname = "compressai";
32   version = "1.2.6";
33   pyproject = true;
35   src = fetchFromGitHub {
36     owner = "InterDigitalInc";
37     repo = "CompressAI";
38     tag = "v${version}";
39     hash = "sha256-xvzhhLn0iBzq3h1nro8/83QWEQe9K4zRa3RSZk+hy3Y=";
40     fetchSubmodules = true;
41   };
43   build-system = [
44     pybind11
45     setuptools
46   ];
48   dependencies = [
49     einops
50     numpy
51     matplotlib
52     pandas
53     pytorch-msssim
54     scipy
55     torch
56     torch-geometric
57     torchvision
58   ];
60   optional-dependencies = {
61     tutorials = [
62       ipywidgets
63       jupyter
64     ];
65   };
67   pythonImportsCheck = [
68     "compressai"
69     "compressai._CXX"
70   ];
72   preCheck = ''
73     # We have to delete the source because otherwise it is used intead the installed package.
74     rm -rf compressai
76     export HOME=$(mktemp -d)
77   '';
79   nativeCheckInputs = [
80     plotly
81     pytestCheckHook
82   ];
84   disabledTests = [
85     # Those tests require internet access to download some weights
86     "test_image_codec"
87     "test_update"
88     "test_eval_model_pretrained"
89     "test_cheng2020_anchor"
90     "test_pretrained"
92     # Flaky (AssertionError: assert 0.08889999999999998 < 0.064445)
93     "test_find_close"
94   ];
96   meta = {
97     description = "PyTorch library and evaluation platform for end-to-end compression research";
98     homepage = "https://github.com/InterDigitalInc/CompressAI";
99     license = lib.licenses.bsd3Clear;
100     maintainers = with lib.maintainers; [ GaetanLepage ];
101   };