git: 0adf98655864 - main - misc/py-torchvision: New port: PyTorch: Datasets, transforms and models specific to computer vision

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Mon, 08 May 2023 04:16:45 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0adf986558649c4975340618b122dcd59132db50

commit 0adf986558649c4975340618b122dcd59132db50
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2023-05-08 04:15:56 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2023-05-08 04:16:34 +0000

    misc/py-torchvision: New port: PyTorch: Datasets, transforms and models specific to computer vision
---
 misc/Makefile                 |  1 +
 misc/py-torchvision/Makefile  | 34 ++++++++++++++++++++++++++++++++++
 misc/py-torchvision/distinfo  |  3 +++
 misc/py-torchvision/pkg-descr |  2 ++
 4 files changed, 40 insertions(+)

diff --git a/misc/Makefile b/misc/Makefile
index 6cc050e71a62..16f377651edf 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -466,6 +466,7 @@
     SUBDIR += py-tflite
     SUBDIR += py-tflite-support
     SUBDIR += py-toil
+    SUBDIR += py-torchvision
     SUBDIR += py-tqdm
     SUBDIR += py-tvm
     SUBDIR += py-uhi
diff --git a/misc/py-torchvision/Makefile b/misc/py-torchvision/Makefile
new file mode 100644
index 000000000000..d45e7e51cadb
--- /dev/null
+++ b/misc/py-torchvision/Makefile
@@ -0,0 +1,34 @@
+PORTNAME=	torchvision
+DISTVERSIONPREFIX=	v
+DISTVERSION=	0.15.2-rc2
+CATEGORIES=	misc # machine-learning
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	PyTorch: Datasets, transforms and models specific to computer vision
+WWW=		https://pytorch.org/vision/stable/index.html
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+LIB_DEPENDS=	libpng16.so:graphics/png
+PY_DEPENDS=	${PYNUMPY} \
+		${PYTHON_PKGNAMEPREFIX}pillow>=5.3.0:graphics/py-pillow@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pytorch>0:misc/py-pytorch@${PY_FLAVOR}
+BUILD_DEPENDS=	${PY_DEPENDS}
+RUN_DEPENDS=	${PY_DEPENDS}
+
+USES=		python
+USE_PYTHON=	distutils autoplist
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	pytorch
+GH_PROJECT=	vision
+
+post-install: # strip binaries
+	@${STRIP_CMD} \
+		${STAGEDIR}${PYTHON_SITELIBDIR}/torchvision/_C.so \
+		${STAGEDIR}${PYTHON_SITELIBDIR}/torchvision/image.so
+
+.include <bsd.port.mk>
diff --git a/misc/py-torchvision/distinfo b/misc/py-torchvision/distinfo
new file mode 100644
index 000000000000..fcc27e3db54f
--- /dev/null
+++ b/misc/py-torchvision/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1683503135
+SHA256 (pytorch-vision-v0.15.2-rc2_GH0.tar.gz) = 415db127b72b5f2f3ea46f81b4cfcd49d97b72c0e2421bc6fcb6e9c80f634219
+SIZE (pytorch-vision-v0.15.2-rc2_GH0.tar.gz) = 13091064
diff --git a/misc/py-torchvision/pkg-descr b/misc/py-torchvision/pkg-descr
new file mode 100644
index 000000000000..ac92e7c23b1c
--- /dev/null
+++ b/misc/py-torchvision/pkg-descr
@@ -0,0 +1,2 @@
+The torchvision package consists of popular datasets, model architectures, and
+common image transformations for computer vision.