-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
executable file
·91 lines (81 loc) · 2.53 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
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('butterflydetector/__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('butterflydetector.functional',
['butterflydetector/functional.pyx'],
include_dirs=[numpy.get_include()]),
],
annotate=True,
compiler_directives={'language_level': 3})
else:
EXTENSIONS = [Extension('butterflydetector.functional',
['butterflydetector/functional.pyx'],
include_dirs=[NumpyIncludePath()])]
setup(
name='butterflydetector',
version=VERSION,
packages=[
'butterflydetector',
'butterflydetector.decoder',
'butterflydetector.decoder.generator',
'butterflydetector.encoder',
'butterflydetector.network',
'butterflydetector.transforms',
'butterflydetector.data_manager',
],
license='GNU AGPLv3',
description='Butterfly Detector for Aerial Images',
long_description=open('README.md', encoding='utf-8').read(),
long_description_content_type='text/markdown',
author='George Adaimi',
author_email='[email protected]',
url='https://github.com/vita-epfl/butterflydetector',
ext_modules=EXTENSIONS,
zip_safe=False,
install_requires=[
'numpy>=1.16',
'pysparkling', # for log analysis
'python-json-logger',
'scipy',
'pandas',
'torch>=1.1.0',
'torchvision>=0.3',
'yacs',
'matplotlib',
'pillow', # temporary compat requirement for torchvision
],
extras_require={
'onnx': [
'onnx',
'onnx-simplifier',
],
'test': [
'pylint',
'pytest',
'opencv-python',
],
'train': [
'matplotlib',
'torch>=1.3.0',
'torchvision>=0.4',
],
},
)