forked from openpifpaf/openpifpaf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
102 lines (92 loc) · 2.8 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
from setuptools import setup
from setuptools.extension import Extension
try:
from Cython.Build import cythonize
except ImportError:
cythonize = None
try:
import numpy
except ImportError:
numpy = None
# extract version from __init__.py
with open('openpifpaf/__init__.py', 'r') as f:
VERSION_LINE = [l for l in f if l.startswith('__version__')][0]
VERSION = VERSION_LINE.split('=')[1].strip()[1:-1]
class NumpyIncludePath(object):
"""Lazy import of numpy to get include path."""
@staticmethod
def __str__():
import numpy
return numpy.get_include()
if cythonize is not None and numpy 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.pyx'],
include_dirs=[NumpyIncludePath()])]
setup(
name='openpifpaf',
version=VERSION,
packages=[
'openpifpaf',
'openpifpaf.datasets',
'openpifpaf.decoder',
'openpifpaf.decoder.generator',
'openpifpaf.encoder',
'openpifpaf.network',
'openpifpaf.show',
'openpifpaf.transforms',
'openpifpaf.visualizer',
],
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/vita-epfl/openpifpaf',
ext_modules=EXTENSIONS,
zip_safe=False,
python_requires='>=3.6',
install_requires=[
'numpy>=1.16',
'pysparkling', # for log analysis
'python-json-logger',
'scipy',
'torch>=1.3.1',
'torchvision>=0.4',
'pillow',
'dataclasses; python_version<"3.7"',
],
extras_require={
'dev': [
'flameprof',
'jupyter-book>=0.7.0b',
'matplotlib',
'nbdime',
'nbstripout',
],
'onnx': [
'onnx',
'onnx-simplifier>=0.2.9',
],
'test': [
'nbval',
'onnx',
'onnx-simplifier>=0.2.9',
'pylint',
'pytest',
'opencv-python',
'thop',
],
'train': [
'matplotlib', # required by pycocotools
'pycocotools', # pre-install cython (currently incompatible with numpy 1.18 or above)
],
},
)