-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
88 lines (76 loc) · 2.64 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
import glob
import sys
import os
import shutil
from distutils.spawn import find_executable
import setuptools
import subprocess
from typing import List
file_dir = os.path.dirname(os.path.realpath(__file__))
def runcmd(cmds: List[str]):
return subprocess.call(cmds, shell=True)
# Find the Protocol Compiler.
if 'PROTOC' in os.environ and os.path.exists(os.environ['PROTOC']):
protoc = os.environ['PROTOC']
else:
protoc = find_executable("protoc")
if not protoc:
error = "protoc command not found in PATH."\
" install the protoc command system wide or set the PROTOC env"\
" variable with protoc executable path."
print(error)
sys.exit(1)
proto_commands = [
"cd ./tf_object_detection/research;" +
protoc +
" object_detection/protos/*.proto" +
" --python_out=."
]
# Pull the upstream object_detection code and package it.
runcmd(['git', 'submodule', 'update', '--init'])
runcmd(proto_commands)
with open(os.path.join(file_dir, 'README.md')) as f:
long_description = f.read()
install_requires = [
'setuptools>=41.0.0', # tensorboard requirements
'cython',
'contextlib2',
'pillow',
'lxml',
# replacement for pycocotools, as the published pypi package fails on cython and numpy dependencies
'pycocotools-fix',
'jupyter',
'matplotlib'
]
extras_require = {
'tf': ['tensorflow<2.0'],
'tf-gpu': ['tensorflow-gpu<2.0'],
}
setuptools.setup(
name='tf_object_detection',
version='0.0.3',
author='Junjue Wang',
author_email='[email protected]',
description='A Thin Wrapper around Tensorflow Object Detection API for Easy Installation and Use',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/junjuew/tf_object_detection',
packages=setuptools.find_packages(
where='tf_object_detection/research', include=['object_detection', 'object_detection.*']) + setuptools.find_packages(
where='tf_object_detection/research/slim'),
package_dir={
'': 'tf_object_detection/research/slim', # tf slim dependencies
'object_detection': 'tf_object_detection/research/object_detection'},
license='Apache License 2.0',
install_requires=install_requires,
extras_require=extras_require,
python_requires='>=3.6, <4.0', # matplotlib >3.1 requires python >=3.6
classifiers=[
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
]
)