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-04-26 19:14:03 +00:00
|
|
|
version = "0.9.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-04-26 19:14:03 +00:00
|
|
|
sha256 = "0rw186nki7q8igk481p2mvx4n763i3kpn663yp3dibkimddpnf9k";
|
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
|
|
|
};
|
|
|
|
}
|