summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-04-15 16:08:08 +0000
committerCoprDistGit <infra@openeuler.org>2024-04-15 16:08:08 +0000
commit55bcfa84d5dc68140a0207ec188bd557b33d8a8c (patch)
treed7c88b54176f21aef51773e25512288da6819f2b
parent7c2e8f949b9d009a58a5d96c901604c8ad8343a3 (diff)
automatic import of torchvision
-rw-r--r--sources2
-rw-r--r--torchvision.spec67
-rw-r--r--tst.patch13
-rw-r--r--vision.spec56
4 files changed, 81 insertions, 57 deletions
diff --git a/sources b/sources
index 695ece4..75641de 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-73e4905cd63ecc614fc6abf2d0a1d171 v0.17.2.tar.gz
+a0e7f9cc2aa638576fd8088813377294 v0.16.2.tar.gz
diff --git a/torchvision.spec b/torchvision.spec
new file mode 100644
index 0000000..99a6a01
--- /dev/null
+++ b/torchvision.spec
@@ -0,0 +1,67 @@
+Summary: The torchvision package consists of popular datasets, model architectures, and common image transformations for computer vision.
+Name: torchvision
+Version: 0.16.2
+Release: 1
+License: BSD
+Group: Development/Libraries
+Source0: https://github.com/pytorch/vision/archive/refs/tags/v0.16.2.tar.gz
+URL: https://github.com/pytorch/vision
+BuildRoot: %{_tmppath}/%{name}-buildroot
+Patch0: tst.patch
+
+Requires: python3-pytorch
+Requires: python3-numpy
+Requires: python3-pillow
+Requires: python3-requests
+Requires: python3-scipy
+Requires: python3-sympy
+
+%description
+Torchvision is a PyTorch add-on that provides access to:
+- Datasets (MNIST, CIFAR10, etc.)
+- Models (ResNet, VGG, etc.)
+- Transforms (for image preprocessing)
+
+%package -n python3-torchvision
+Summary: The torchvision package consists of popular datasets, model architectures, and common image transformations for computer vision.
+Provides: python-torchvision
+BuildRequires: python3-pytorch
+BuildRequires: python3-requests
+BuildRequires: python3-pip
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-setuptools_scm
+BuildRequires: python3-pbr
+BuildRequires: python3-wheel
+BuildRequires: python3-hatchling
+BuildRequires: ffmpeg ffmpeg-devel ffmpeg-libs
+BuildRequires: ninja-build
+BuildRequires: numactl
+BuildRequires: cmake
+
+%description -n python3-torchvision
+Torchvision is a PyTorch add-on that provides access to:
+- Datasets (MNIST, CIFAR10, etc.)
+- Models (ResNet, VGG, etc.)
+- Transforms (for image preprocessing)
+
+%global pypi_version 0.16.2
+
+%prep
+%autosetup -p1 -n vision-%{pypi_version}
+%patch -P 0 -p1
+
+%build
+%pyproject_build
+
+%install
+%pyproject_install
+
+%files
+%doc *.md
+%license LICENSE
+%{python3_sitearch}/*
+
+%changelog
+* Mon Apr 15 2024 weilaijishu
+- Initial package
diff --git a/tst.patch b/tst.patch
new file mode 100644
index 0000000..7770526
--- /dev/null
+++ b/tst.patch
@@ -0,0 +1,13 @@
+diff --git a/setup.py b/setup.py
+index ce67413..6b376c2 100644
+--- a/setup.py
++++ b/setup.py
+@@ -64,7 +64,7 @@ requirements = [
+ ]
+
+ # Excluding 8.3.* because of https://github.com/pytorch/vision/issues/4934
+-pillow_ver = " >= 5.3.0, !=8.3.*"
++pillow_ver = " >= 5.3.0, !=8.3.1, !=8.3.2, !=8.3.3"
+ pillow_req = "pillow-simd" if get_dist("pillow-simd") is not None else "pillow"
+ requirements.append(pillow_req + pillow_ver)
+ \ No newline at end of file
diff --git a/vision.spec b/vision.spec
deleted file mode 100644
index c596e29..0000000
--- a/vision.spec
+++ /dev/null
@@ -1,56 +0,0 @@
-%global _empty_manifest_terminate_build 0
-%global _unpackaged_files_terminate_build 0
-%global pypi_name torchvision
-
-Name: %{pypi_name}
-Version: 0.17.2
-Release: 1%{?dist}
-Summary: %{name} is a torch ecosystem tools
-
-License: BSD-3
-URL: https://pytorch.org/vision
-Source0: https://github.com/pytorch/vision/archive/refs/tags/v%{version}.tar.gz
-
-
-%description
-datasets and models for the pytorch paper
-
-
-# pkg 1
-%package -n python3-%{name}
-Summary: a model and datasets for pytorch
-BuildRequires: python3-devel
-BuildRequires: python3-setuptools
-BuildRequires: python3-pytorch
-Requires: python3-requests
-
-%description -n python3-%{pypi_name}
-datasets and models for the pytorch paper
-
-# pkg 2
-%package -n python3-%{pypi_name}-doc
-Summary: doc for the %{name} lib.
-
-%description -n python3-%{pypi_name}-doc
-description for helping using the torchvision lib
-
-%prep
-%autosetup -p1 -n vision-%{version}
-rm -rf %{pypi_name}.egg-info
-
-
-%build
-%py3_build
-
-%install
-%py3_install
-
-%files -n python3-%{pypi_name}
-%doc *.md
-%license LICENSE
-#%{python3_sitelib}/%{pypi_name}
-%{python3_sitearch}/%{name}
-
-%changelog
-* Sun Mar 31 2024 Super User
-- pkg init