-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
36 lines (32 loc) · 1.03 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
import torch
from setuptools import setup, find_packages
from torch.utils.cpp_extension import BuildExtension, CUDAExtension, CppExtension
modules = [
CppExtension(
'roi_align.crop_and_resize_cpu',
['roi_align/src/crop_and_resize.cpp'],
extra_compile_args={'cxx': ['-g', '-fopenmp']}
)
]
if torch.cuda.is_available():
modules.append(
CUDAExtension(
'roi_align.crop_and_resize_gpu',
['roi_align/src/crop_and_resize_gpu.cpp',
'roi_align/src/cuda/crop_and_resize_kernel.cu'],
extra_compile_args={'cxx': ['-g', '-fopenmp'],
'nvcc': ['-O2']}
)
)
setup(
name='roi_align',
version='0.0.2',
description='PyTorch version of RoIAlign',
author='Long Chen',
author_email='[email protected]',
url='https://github.com/longcw/RoIAlign.pytorch',
packages=find_packages(exclude=('tests',)),
ext_modules=modules,
cmdclass={'build_ext': BuildExtension},
install_requires=['torch>=1.2.0']
)