mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-15 00:54:46 +00:00
51 lines
1,015 B
Nix
51 lines
1,015 B
Nix
{ lib
|
|
, buildPythonPackage
|
|
, fetchFromGitHub
|
|
, ninja
|
|
, which
|
|
, libjpeg_turbo
|
|
, libpng
|
|
, numpy
|
|
, scipy
|
|
, pillow
|
|
, pytorch
|
|
, pytest
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "torchvision";
|
|
version = "0.10.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "pytorch";
|
|
repo = "vision";
|
|
rev = "v${version}";
|
|
sha256 = "13j04ij0jmi58nhav1p69xrm8dg7jisg23268i3n6lnms37n02kc";
|
|
};
|
|
|
|
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 ];
|
|
|
|
meta = with lib; {
|
|
description = "PyTorch vision library";
|
|
homepage = "https://pytorch.org/";
|
|
license = licenses.bsd3;
|
|
maintainers = with maintainers; [ ericsagnes ];
|
|
};
|
|
}
|