From d1ed87868f117192ce6b330529bcc0cc48597f00 Mon Sep 17 00:00:00 2001 From: kairi003 Date: Mon, 6 Mar 2023 19:31:01 +0000 Subject: [PATCH 1/3] Fix: install_requires following detectron2 Fixed install_requires that was causing issues with pure-python, using detectron2/setup.py as reference. --- setup.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 185c7d64f..0d68d2740 100644 --- a/setup.py +++ b/setup.py @@ -3,13 +3,34 @@ from setuptools import find_packages, setup + +# Check dependencies +import torchvision +import cv2 +import detectron2 +torchvision_ver = [int(x) for x in torchvision.__version__.split(".")][:3] +assert torchvision >= [0, 4, 2] + + setup( name="slowfast", version="1.0", author="FAIR", - url="unknown", + url="https://github.com/facebookresearch/SlowFast", description="SlowFast Video Understanding", install_requires=[ + # These dependencies are not pure-python. + # In general, avoid adding dependencies that are not pure-python because they are not + # guaranteed to be installable by `pip install` on all platforms. + "Pillow", # or use pillow-simd for better performance + # Do not add opencv here. Just like pytorch, user should install + # opencv themselves, preferrably by OS's package manager, or by + # choosing the proper pypi package name at https://github.com/skvark/opencv-python + # Also, avoid adding dependencies that transitively depend on pytorch or opencv. + # ------------------------------------------------------------ + # The following are pure-python dependencies that should be easily installable. + # But still be careful when adding more: fewer people are able to use the software + # with every new dependency added. "yacs>=0.1.6", "pyyaml>=5.1", "av", @@ -19,11 +40,7 @@ "tqdm", "psutil", "matplotlib", - "detectron2", - "opencv-python", "pandas", - "torchvision>=0.4.2", - "PIL", "sklearn", "tensorboard", "fairscale", From 985481bf99f0a8c83c9670b93cfb2f4fcb36160d Mon Sep 17 00:00:00 2001 From: kairi003 Date: Mon, 6 Mar 2023 20:52:26 +0000 Subject: [PATCH 2/3] Fix: Resolve version formats with RE --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 0d68d2740..800ba841f 100644 --- a/setup.py +++ b/setup.py @@ -2,14 +2,14 @@ # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. from setuptools import find_packages, setup - +import re # Check dependencies import torchvision import cv2 import detectron2 -torchvision_ver = [int(x) for x in torchvision.__version__.split(".")][:3] -assert torchvision >= [0, 4, 2] +torchvision_ver = re.match(r'(?:\d+!)?([\.\d]+)', torchvision.__version__)[1] +assert [int(x) for x in torchvision_ver.split(".")] >= [0, 4, 2] setup( From 06594021f09cc76472d6fdea6e320781ef5ed3f1 Mon Sep 17 00:00:00 2001 From: kairi003 Date: Sat, 25 Mar 2023 00:12:40 +0900 Subject: [PATCH 3/3] Fix: sklearn module name --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 800ba841f..460d87754 100644 --- a/setup.py +++ b/setup.py @@ -41,7 +41,7 @@ "psutil", "matplotlib", "pandas", - "sklearn", + "scikit-learn", "tensorboard", "fairscale", ],