forked from openpifpaf/openpifpaf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
108 lines (98 loc) · 3.36 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
from setuptools import setup, find_packages
from setuptools.extension import Extension
# This is needed for versioneer to be importable when building with PEP 517.
# See <https://github.com/warner/python-versioneer/issues/193> and links
# therein for more information.
import os, sys
sys.path.append(os.path.dirname(__file__))
import versioneer
try:
from Cython.Build import cythonize
except ImportError:
cythonize = None
try:
import numpy
except ImportError as e:
print('install numpy first')
raise e
if cythonize is not None:
EXTENSIONS = cythonize([Extension('openpifpaf.functional',
['openpifpaf/functional.pyx'],
include_dirs=[numpy.get_include()]),
],
annotate=True,
compiler_directives={'language_level': 3})
else:
EXTENSIONS = [Extension('openpifpaf.functional',
['openpifpaf/functional.c'],
include_dirs=[numpy.get_include()])]
setup(
name='openpifpaf',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
packages=find_packages(),
license='GNU AGPLv3',
description='PifPaf: Composite Fields for Human Pose Estimation',
long_description=open('README.md', encoding='utf-8').read(),
long_description_content_type='text/markdown',
author='Sven Kreiss',
author_email='[email protected]',
url='https://github.com/openpifpaf/openpifpaf',
ext_modules=EXTENSIONS,
zip_safe=False,
python_requires='>=3.6',
install_requires=[
'importlib_metadata!=3.8.0', # temporary for pytest
'numpy>=1.16',
'pysparkling', # for log analysis
'python-json-logger',
'torch>=1.7.1',
'torchvision>=0.8.2',
'pillow!=8.3.0', # exclusion torchvision 0.10.0 compatibility
'dataclasses; python_version<"3.7"',
],
extras_require={
'backbones': [
'timm>=0.4.9', # For Swin Transformer and XCiT
'einops>=0.3', # required for BotNet
],
'dev': [
'cython',
'flameprof',
'jupyter-book>=0.9.1',
'matplotlib>=3.3',
'nbdime',
'nbstripout',
'scipy',
'sphinx-book-theme',
'wheel',
],
'onnx': [
'onnx',
'onnxruntime',
'onnx-simplifier>=0.2.9; python_version<"3.9"', # Python 3.9 not supported yet
],
'coreml': [
'coremltools>=4.1',
],
'test': [
'nbconvert',
'nbstripout',
'nbval',
'onnx',
'onnxruntime',
'onnx-simplifier>=0.2.9; python_version<"3.9"', # Python 3.9 not supported yet
'pylint<2.9.4', # avoid 2.9.4 and up for time.perf_counter deprecation warnings
'pycodestyle',
'pytest',
'opencv-python',
'thop',
],
'train': [
'matplotlib>=3.3', # required by pycocotools
'pycocotools>=2.0.1', # pre-install cython (currently incompatible with numpy 1.18 or above)
'scipy',
'xtcocotools>=1.5; sys_platform == "linux"', # required for wholebody eval, only wheels and only for linux on pypi
],
},
)