aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-libs/torchvision')
-rw-r--r--sci-libs/torchvision/Manifest2
-rw-r--r--sci-libs/torchvision/files/torchvision-0.17.1-ffmpeg-6.patch36
-rw-r--r--sci-libs/torchvision/metadata.xml11
-rw-r--r--sci-libs/torchvision/torchvision-0.14.1.ebuild40
-rw-r--r--sci-libs/torchvision/torchvision-0.17.1.ebuild45
5 files changed, 134 insertions, 0 deletions
diff --git a/sci-libs/torchvision/Manifest b/sci-libs/torchvision/Manifest
new file mode 100644
index 000000000..7cf5fa956
--- /dev/null
+++ b/sci-libs/torchvision/Manifest
@@ -0,0 +1,2 @@
+DIST torchvision-0.14.1.tar.gz 9265179 BLAKE2B 0708635b00ac7c2cf4e54799f1190f01f3240f53233695819f691313b8a369b8922520e2f3cf96184bab671877b5826b84e0936d9ca5b58004d6e2a098c6cbbf SHA512 08fb1e35da1c3f1d0446ef879d9b6a7ae839a5137c3b5b46ef8111c2ae890299e2b555d1bd3b3d61f96b8778b831d8f895487cf8a4e36e371fcd4b8acda67d1f
+DIST torchvision-0.17.1.tar.gz 13091686 BLAKE2B db25faab565412f2892ca4cf8d13c459b8045aaab83009a686a93272f0b3e3e8c0da930f1d7b0682e0adc7a600195b035ca19f71fd15a26f77b349206e3ed324 SHA512 c9ef5704a337a43c1ab3a5865b2a20d09d07a9b5eeda66c7aa1e1931772bad9acee822bb400cf627960a84ace01188cd32e95f0e709eb392bf9028d36cfc50be
diff --git a/sci-libs/torchvision/files/torchvision-0.17.1-ffmpeg-6.patch b/sci-libs/torchvision/files/torchvision-0.17.1-ffmpeg-6.patch
new file mode 100644
index 000000000..7a3637f3a
--- /dev/null
+++ b/sci-libs/torchvision/files/torchvision-0.17.1-ffmpeg-6.patch
@@ -0,0 +1,36 @@
+From 86620bd84b872b76db0acafec167949dca03a29e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zolt=C3=A1n=20B=C3=B6sz=C3=B6rm=C3=A9nyi?=
+ <zboszor@gmail.com>
+Date: Tue, 7 Nov 2023 10:43:11 +0100
+Subject: [PATCH] Fix build with ffmpeg 6.0
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
+---
+ torchvision/csrc/io/decoder/stream.cpp | 11 ++---------
+ 1 file changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/torchvision/csrc/io/decoder/stream.cpp b/torchvision/csrc/io/decoder/stream.cpp
+index 0d625ef211c..8c914050587 100644
+--- a/torchvision/csrc/io/decoder/stream.cpp
++++ b/torchvision/csrc/io/decoder/stream.cpp
+@@ -63,15 +63,8 @@ int Stream::openCodec(std::vector<DecoderMetadata>* metadata, int num_threads) {
+ codecCtx_->thread_count = num_threads;
+ } else {
+ // otherwise set sensible defaults
+- // with the special case for the different MPEG4 codecs
+- // that don't have threading context functions
+- if (codecCtx_->codec->capabilities & AV_CODEC_CAP_INTRA_ONLY) {
+- codecCtx_->thread_type = FF_THREAD_FRAME;
+- codecCtx_->thread_count = 2;
+- } else {
+- codecCtx_->thread_count = 8;
+- codecCtx_->thread_type = FF_THREAD_SLICE;
+- }
++ codecCtx_->thread_count = 8;
++ codecCtx_->thread_type = FF_THREAD_SLICE;
+ }
+
+ int ret;
diff --git a/sci-libs/torchvision/metadata.xml b/sci-libs/torchvision/metadata.xml
new file mode 100644
index 000000000..9c4ddaefd
--- /dev/null
+++ b/sci-libs/torchvision/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>jpizarrocallejas@gmail.com</email>
+ <name>Jorge Pizarro Callejas</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">pytorch/vision</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/sci-libs/torchvision/torchvision-0.14.1.ebuild b/sci-libs/torchvision/torchvision-0.14.1.ebuild
new file mode 100644
index 000000000..7f40fe556
--- /dev/null
+++ b/sci-libs/torchvision/torchvision-0.14.1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 2020-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_10 )
+DISTUTILS_SINGLE_IMPL=1
+DISTUTILS_USE_PEP517=setuptools
+inherit distutils-r1
+
+DESCRIPTION="Datasets, transforms and models to specific to computer vision"
+HOMEPAGE="https://github.com/pytorch/vision"
+SRC_URI="https://github.com/pytorch/vision/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/vision-${PV}"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="
+ $(python_gen_cond_dep '
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/typing-extensions[${PYTHON_USEDEP}]
+ dev-python/pillow[${PYTHON_USEDEP}]
+ dev-python/requests[${PYTHON_USEDEP}]
+ dev-python/scipy[${PYTHON_USEDEP}]
+ ')
+ sci-libs/pytorch[${PYTHON_SINGLE_USEDEP}]
+ media-video/ffmpeg
+ dev-qt/qtcore:5
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ test? (
+ $(python_gen_cond_dep '
+ dev-python/mock[${PYTHON_USEDEP}]
+ ')
+ )"
+
+distutils_enable_tests pytest
diff --git a/sci-libs/torchvision/torchvision-0.17.1.ebuild b/sci-libs/torchvision/torchvision-0.17.1.ebuild
new file mode 100644
index 000000000..e0c72684c
--- /dev/null
+++ b/sci-libs/torchvision/torchvision-0.17.1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 2020-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+DISTUTILS_SINGLE_IMPL=1
+DISTUTILS_USE_PEP517=setuptools
+DISTUTILS_EXT=1
+inherit distutils-r1 multiprocessing
+
+DESCRIPTION="Datasets, transforms and models to specific to computer vision"
+HOMEPAGE="https://github.com/pytorch/vision"
+SRC_URI="https://github.com/pytorch/vision/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/vision-${PV}"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64"
+RESTRICT="test"
+
+RDEPEND="
+ $(python_gen_cond_dep '
+ dev-python/numpy[${PYTHON_USEDEP}]
+ dev-python/typing-extensions[${PYTHON_USEDEP}]
+ dev-python/pillow[${PYTHON_USEDEP}]
+ dev-python/requests[${PYTHON_USEDEP}]
+ dev-python/scipy[${PYTHON_USEDEP}]
+ ')
+ sci-libs/pytorch[${PYTHON_SINGLE_USEDEP}]
+ media-video/ffmpeg:=
+"
+DEPEND="${RDEPEND}"
+
+PATCHES=( "${FILESDIR}/${PN}-0.17.1-ffmpeg-6.patch" )
+
+src_compile()
+{
+ export MAX_JOBS="$(makeopts_jobs)" # Let ninja respect MAKEOPTS
+
+ # Ensure some ext_module sources are compiled before linking
+ export MAKEOPTS="-j1"
+
+ distutils-r1_src_compile
+}