-
Notifications
You must be signed in to change notification settings - Fork 17
/
setup.py
78 lines (66 loc) · 2.32 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
from os import path, listdir
import setuptools
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
def find_sources(root_dir):
sources = []
for file in listdir(root_dir):
_, ext = path.splitext(file)
if ext in [".cpp", ".cu"]:
sources.append(path.join(root_dir, file))
return sources
def make_extension(name, package):
return CUDAExtension(
name="{}.{}._backend".format(package, name),
sources=find_sources(path.join("src", name)),
extra_compile_args={
"cxx": ["-O3"],
"nvcc": ["--expt-extended-lambda"],
},
include_dirs=["include/"],
)
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setuptools.setup(
# Meta-data
name="GraspDetSeg_CNN",
author="Stefan Ainetter",
author_email="stefan.ainetter@icg.tugraz.at",
description="Grasp Detection and Segmentation for Pytorch, code based on Seamless Scene Segmentation (https://github.com/mapillary/seamseg).",
long_description_content_type="text/markdown",
url="",
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
# Versioning
use_scm_version={"root": ".", "relative_to": __file__, "write_to": "grasp_det_seg/_version.py"},
# Requirements
setup_requires=["setuptools_scm"],
python_requires=">=3, <4",
# Package description
packages=[
"grasp_det_seg",
"grasp_det_seg.algos",
"grasp_det_seg.config",
"grasp_det_seg.data_OCID",
"grasp_det_seg.models",
"grasp_det_seg.modules",
"grasp_det_seg.modules.heads",
"grasp_det_seg.utils",
"grasp_det_seg.utils.bbx",
"grasp_det_seg.utils.nms",
"grasp_det_seg.utils.parallel",
"grasp_det_seg.utils.roi_sampling",
],
ext_modules=[
make_extension("nms", "grasp_det_seg.utils"),
make_extension("bbx", "grasp_det_seg.utils"),
make_extension("roi_sampling", "grasp_det_seg.utils")
],
cmdclass={"build_ext": BuildExtension},
include_package_data=True,
)