forked from openpifpaf/openpifpaf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
83 lines (73 loc) · 2.21 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
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.decoder',
'openpifpaf.encoder',
'openpifpaf.network',
],
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,
install_requires=[
'numpy>=1.16',
'pysparkling', # for log analysis
'python-json-logger',
'scipy',
'torch>=1.1.0',
'torchvision>=0.3',
],
extras_require={
'onnx': [
'onnx',
'onnx-simplifier',
],
'test': [
'pylint',
'pytest',
'opencv-python',
],
'train': [
'matplotlib',
'pycocotools', # pre-install cython
],
},
)