2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2021-01-05 17:05:55 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, ninja
|
|
|
|
, which
|
|
|
|
, libjpeg_turbo
|
|
|
|
, libpng
|
2020-04-24 23:36:52 +00:00
|
|
|
, numpy
|
2021-01-05 17:05:55 +00:00
|
|
|
, scipy
|
2020-04-24 23:36:52 +00:00
|
|
|
, pillow
|
|
|
|
, pytorch
|
2021-01-05 17:05:55 +00:00
|
|
|
, pytest
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2021-01-05 17:05:55 +00:00
|
|
|
pname = "torchvision";
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "0.10.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pytorch";
|
|
|
|
repo = "vision";
|
|
|
|
rev = "v${version}";
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "13j04ij0jmi58nhav1p69xrm8dg7jisg23268i3n6lnms37n02kc";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-01-05 17:05:55 +00:00
|
|
|
nativeBuildInputs = [ libpng ninja which ];
|
|
|
|
|
|
|
|
TORCHVISION_INCLUDE = "${libjpeg_turbo.dev}/include/";
|
|
|
|
TORCHVISION_LIBRARY = "${libjpeg_turbo}/lib/";
|
|
|
|
|
|
|
|
buildInputs = [ libjpeg_turbo libpng ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ numpy pillow pytorch scipy ];
|
|
|
|
|
|
|
|
# tries to download many datasets for tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
HOME=$TMPDIR py.test test --ignore=test/test_datasets_download.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [ pytest ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "PyTorch vision library";
|
2021-01-05 17:05:55 +00:00
|
|
|
homepage = "https://pytorch.org/";
|
|
|
|
license = licenses.bsd3;
|
2021-02-17 17:02:09 +00:00
|
|
|
maintainers = with maintainers; [ ericsagnes ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|