2020-06-28 23:15:47 +08:00
|
|
|
import glob
|
|
|
|
import os
|
2019-11-21 23:34:26 +08:00
|
|
|
import re
|
2021-08-10 16:17:59 +08:00
|
|
|
from pkg_resources import DistributionNotFound, get_distribution
|
2020-12-13 19:43:25 +08:00
|
|
|
from setuptools import find_packages, setup
|
2020-07-07 01:00:37 +08:00
|
|
|
|
|
|
|
EXT_TYPE = ''
|
|
|
|
try:
|
|
|
|
import torch
|
|
|
|
if torch.__version__ == 'parrots':
|
|
|
|
from parrots.utils.build_extension import BuildExtension
|
|
|
|
EXT_TYPE = 'parrots'
|
|
|
|
else:
|
|
|
|
from torch.utils.cpp_extension import BuildExtension
|
|
|
|
EXT_TYPE = 'pytorch'
|
2020-12-13 19:43:25 +08:00
|
|
|
cmd_class = {'build_ext': BuildExtension}
|
2020-07-07 01:00:37 +08:00
|
|
|
except ModuleNotFoundError:
|
2020-12-13 19:43:25 +08:00
|
|
|
cmd_class = {}
|
2020-07-07 01:00:37 +08:00
|
|
|
print('Skip building ext ops due to the absence of torch.')
|
2018-08-27 02:12:31 +08:00
|
|
|
|
2019-11-21 23:34:26 +08:00
|
|
|
|
|
|
|
def choose_requirement(primary, secondary):
|
2020-07-04 00:55:25 +08:00
|
|
|
"""If some version of primary requirement installed, return primary, else
|
|
|
|
return secondary."""
|
2019-11-21 23:34:26 +08:00
|
|
|
try:
|
|
|
|
name = re.split(r'[!<>=]', primary)[0]
|
|
|
|
get_distribution(name)
|
|
|
|
except DistributionNotFound:
|
|
|
|
return secondary
|
|
|
|
|
|
|
|
return str(primary)
|
|
|
|
|
|
|
|
|
2018-08-27 02:12:31 +08:00
|
|
|
def get_version():
|
|
|
|
version_file = 'mmcv/version.py'
|
2019-04-22 10:43:33 +08:00
|
|
|
with open(version_file, 'r', encoding='utf-8') as f:
|
2018-08-27 02:12:31 +08:00
|
|
|
exec(compile(f.read(), version_file, 'exec'))
|
|
|
|
return locals()['__version__']
|
|
|
|
|
|
|
|
|
2020-10-31 17:58:15 +08:00
|
|
|
def parse_requirements(fname='requirements/runtime.txt', with_version=True):
|
2020-07-04 00:55:25 +08:00
|
|
|
"""Parse the package dependencies listed in a requirements file but strips
|
2020-05-15 23:08:12 +08:00
|
|
|
specific versioning information.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
fname (str): path to requirements file
|
|
|
|
with_version (bool, default=False): if True include version specs
|
|
|
|
|
|
|
|
Returns:
|
|
|
|
List[str]: list of requirements items
|
|
|
|
|
|
|
|
CommandLine:
|
|
|
|
python -c "import setup; print(setup.parse_requirements())"
|
|
|
|
"""
|
|
|
|
import sys
|
|
|
|
from os.path import exists
|
|
|
|
require_fpath = fname
|
|
|
|
|
|
|
|
def parse_line(line):
|
2020-07-04 00:55:25 +08:00
|
|
|
"""Parse information from a line in a requirements text file."""
|
2020-05-15 23:08:12 +08:00
|
|
|
if line.startswith('-r '):
|
|
|
|
# Allow specifying requirements in other files
|
|
|
|
target = line.split(' ')[1]
|
|
|
|
for info in parse_require_file(target):
|
|
|
|
yield info
|
|
|
|
else:
|
|
|
|
info = {'line': line}
|
|
|
|
if line.startswith('-e '):
|
|
|
|
info['package'] = line.split('#egg=')[1]
|
|
|
|
else:
|
|
|
|
# Remove versioning from the package
|
|
|
|
pat = '(' + '|'.join(['>=', '==', '>']) + ')'
|
|
|
|
parts = re.split(pat, line, maxsplit=1)
|
|
|
|
parts = [p.strip() for p in parts]
|
|
|
|
|
|
|
|
info['package'] = parts[0]
|
|
|
|
if len(parts) > 1:
|
|
|
|
op, rest = parts[1:]
|
|
|
|
if ';' in rest:
|
|
|
|
# Handle platform specific dependencies
|
|
|
|
# http://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-platform-specific-dependencies
|
|
|
|
version, platform_deps = map(str.strip,
|
|
|
|
rest.split(';'))
|
|
|
|
info['platform_deps'] = platform_deps
|
|
|
|
else:
|
|
|
|
version = rest # NOQA
|
|
|
|
info['version'] = (op, version)
|
|
|
|
yield info
|
|
|
|
|
|
|
|
def parse_require_file(fpath):
|
|
|
|
with open(fpath, 'r') as f:
|
|
|
|
for line in f.readlines():
|
|
|
|
line = line.strip()
|
|
|
|
if line and not line.startswith('#'):
|
|
|
|
for info in parse_line(line):
|
|
|
|
yield info
|
|
|
|
|
|
|
|
def gen_packages_items():
|
|
|
|
if exists(require_fpath):
|
|
|
|
for info in parse_require_file(require_fpath):
|
|
|
|
parts = [info['package']]
|
|
|
|
if with_version and 'version' in info:
|
|
|
|
parts.extend(info['version'])
|
|
|
|
if not sys.version.startswith('3.4'):
|
|
|
|
# apparently package_deps are broken in 3.4
|
|
|
|
platform_deps = info.get('platform_deps')
|
|
|
|
if platform_deps is not None:
|
|
|
|
parts.append(';' + platform_deps)
|
|
|
|
item = ''.join(parts)
|
|
|
|
yield item
|
|
|
|
|
|
|
|
packages = list(gen_packages_items())
|
|
|
|
return packages
|
|
|
|
|
|
|
|
|
|
|
|
install_requires = parse_requirements()
|
2020-10-17 17:58:25 +08:00
|
|
|
|
|
|
|
try:
|
|
|
|
# OpenCV installed via conda.
|
|
|
|
import cv2 # NOQA: F401
|
|
|
|
major, minor, *rest = cv2.__version__.split('.')
|
|
|
|
if int(major) < 3:
|
|
|
|
raise RuntimeError(
|
|
|
|
f'OpenCV >=3 is required but {cv2.__version__} is installed')
|
|
|
|
except ImportError:
|
|
|
|
# If first not installed install second package
|
|
|
|
CHOOSE_INSTALL_REQUIRES = [('opencv-python-headless>=3',
|
|
|
|
'opencv-python>=3')]
|
|
|
|
for main, secondary in CHOOSE_INSTALL_REQUIRES:
|
|
|
|
install_requires.append(choose_requirement(main, secondary))
|
2020-05-15 23:08:12 +08:00
|
|
|
|
2019-07-31 02:22:20 +08:00
|
|
|
|
2020-06-28 23:15:47 +08:00
|
|
|
def get_extensions():
|
|
|
|
extensions = []
|
|
|
|
|
2021-01-06 11:05:19 +08:00
|
|
|
if os.getenv('MMCV_WITH_TRT', '0') != '0':
|
|
|
|
ext_name = 'mmcv._ext_trt'
|
|
|
|
from torch.utils.cpp_extension import include_paths, library_paths
|
|
|
|
library_dirs = []
|
|
|
|
libraries = []
|
|
|
|
include_dirs = []
|
|
|
|
tensorrt_path = os.getenv('TENSORRT_DIR', '0')
|
|
|
|
tensorrt_lib_path = glob.glob(
|
|
|
|
os.path.join(tensorrt_path, 'targets', '*', 'lib'))[0]
|
|
|
|
library_dirs += [tensorrt_lib_path]
|
|
|
|
libraries += ['nvinfer', 'nvparsers', 'nvinfer_plugin']
|
|
|
|
libraries += ['cudart']
|
|
|
|
define_macros = []
|
|
|
|
extra_compile_args = {'cxx': []}
|
|
|
|
|
2021-08-10 15:09:19 +08:00
|
|
|
include_path = os.path.abspath('./mmcv/ops/csrc/common/cuda')
|
2021-01-06 11:05:19 +08:00
|
|
|
include_trt_path = os.path.abspath('./mmcv/ops/csrc/tensorrt')
|
|
|
|
include_dirs.append(include_path)
|
|
|
|
include_dirs.append(include_trt_path)
|
|
|
|
include_dirs.append(os.path.join(tensorrt_path, 'include'))
|
|
|
|
include_dirs += include_paths(cuda=True)
|
|
|
|
|
|
|
|
op_files = glob.glob('./mmcv/ops/csrc/tensorrt/plugins/*')
|
|
|
|
define_macros += [('MMCV_WITH_CUDA', None)]
|
|
|
|
define_macros += [('MMCV_WITH_TRT', None)]
|
|
|
|
cuda_args = os.getenv('MMCV_CUDA_ARGS')
|
|
|
|
extra_compile_args['nvcc'] = [cuda_args] if cuda_args else []
|
|
|
|
library_dirs += library_paths(cuda=True)
|
|
|
|
|
|
|
|
from setuptools import Extension
|
|
|
|
ext_ops = Extension(
|
|
|
|
name=ext_name,
|
|
|
|
sources=op_files,
|
|
|
|
include_dirs=include_dirs,
|
|
|
|
define_macros=define_macros,
|
|
|
|
extra_compile_args=extra_compile_args,
|
|
|
|
language='c++',
|
|
|
|
library_dirs=library_dirs,
|
|
|
|
libraries=libraries)
|
|
|
|
extensions.append(ext_ops)
|
|
|
|
|
2020-07-09 02:19:02 +08:00
|
|
|
if os.getenv('MMCV_WITH_OPS', '0') == '0':
|
|
|
|
return extensions
|
|
|
|
|
2020-07-07 01:00:37 +08:00
|
|
|
if EXT_TYPE == 'parrots':
|
|
|
|
ext_name = 'mmcv._ext'
|
|
|
|
from parrots.utils.build_extension import Extension
|
Add new parrots extension implementation for all ops (#794)
* delete all parrots file
add bbox_overlaps new parrots op impl
* support first new impl parrts op (bbox_overlaps)(success test)
* add box_iou_rotated op, test succeed
* add carafe and carafe_naive op, test succeed (one parrots bug need fix)
* add cc_attention op, test success
* add corner_pool op, test success
* add parrots op deform_conv, test success
* add deform_roi_pool op, test success (but has question)
* add focal loss op, test success (gradcheck)
* add masked_conv2d op, test success
* add modulated_deform_conv op, test success
* add nms and nms_rotated op, test success
* add psamask op, test success
* add roi_align op, test_success
* add roi_pool op, test success
* add sync_bn op, test success
* add tin_shift op, test success
* fix test_deform_roi_pool, add parrots test
* skip test_onnx because parrots does not support onnx
* fix c++ lint
* fix python lint
* fix python lint
2021-02-26 19:05:25 +08:00
|
|
|
# new parrots op impl do not use MMCV_USE_PARROTS
|
|
|
|
# define_macros = [('MMCV_USE_PARROTS', None)]
|
|
|
|
define_macros = []
|
2021-08-10 15:09:19 +08:00
|
|
|
include_dirs = []
|
|
|
|
op_files = glob.glob('./mmcv/ops/csrc/pytorch/cuda/*.cu') +\
|
Add new parrots extension implementation for all ops (#794)
* delete all parrots file
add bbox_overlaps new parrots op impl
* support first new impl parrts op (bbox_overlaps)(success test)
* add box_iou_rotated op, test succeed
* add carafe and carafe_naive op, test succeed (one parrots bug need fix)
* add cc_attention op, test success
* add corner_pool op, test success
* add parrots op deform_conv, test success
* add deform_roi_pool op, test success (but has question)
* add focal loss op, test success (gradcheck)
* add masked_conv2d op, test success
* add modulated_deform_conv op, test success
* add nms and nms_rotated op, test success
* add psamask op, test success
* add roi_align op, test_success
* add roi_pool op, test success
* add sync_bn op, test success
* add tin_shift op, test success
* fix test_deform_roi_pool, add parrots test
* skip test_onnx because parrots does not support onnx
* fix c++ lint
* fix python lint
* fix python lint
2021-02-26 19:05:25 +08:00
|
|
|
glob.glob('./mmcv/ops/csrc/parrots/*.cpp')
|
2021-08-10 15:09:19 +08:00
|
|
|
include_dirs.append(os.path.abspath('./mmcv/ops/csrc/common'))
|
|
|
|
include_dirs.append(os.path.abspath('./mmcv/ops/csrc/common/cuda'))
|
2020-07-07 01:00:37 +08:00
|
|
|
cuda_args = os.getenv('MMCV_CUDA_ARGS')
|
Add new parrots extension implementation for all ops (#794)
* delete all parrots file
add bbox_overlaps new parrots op impl
* support first new impl parrts op (bbox_overlaps)(success test)
* add box_iou_rotated op, test succeed
* add carafe and carafe_naive op, test succeed (one parrots bug need fix)
* add cc_attention op, test success
* add corner_pool op, test success
* add parrots op deform_conv, test success
* add deform_roi_pool op, test success (but has question)
* add focal loss op, test success (gradcheck)
* add masked_conv2d op, test success
* add modulated_deform_conv op, test success
* add nms and nms_rotated op, test success
* add psamask op, test success
* add roi_align op, test_success
* add roi_pool op, test success
* add sync_bn op, test success
* add tin_shift op, test success
* fix test_deform_roi_pool, add parrots test
* skip test_onnx because parrots does not support onnx
* fix c++ lint
* fix python lint
* fix python lint
2021-02-26 19:05:25 +08:00
|
|
|
extra_compile_args = {
|
|
|
|
'nvcc': [cuda_args] if cuda_args else [],
|
|
|
|
'cxx': [],
|
|
|
|
}
|
|
|
|
if torch.cuda.is_available() or os.getenv('FORCE_CUDA', '0') == '1':
|
|
|
|
define_macros += [('MMCV_WITH_CUDA', None)]
|
|
|
|
extra_compile_args['nvcc'] += [
|
|
|
|
'-D__CUDA_NO_HALF_OPERATORS__',
|
|
|
|
'-D__CUDA_NO_HALF_CONVERSIONS__',
|
|
|
|
'-D__CUDA_NO_HALF2_OPERATORS__',
|
|
|
|
]
|
2020-07-07 01:00:37 +08:00
|
|
|
ext_ops = Extension(
|
|
|
|
name=ext_name,
|
|
|
|
sources=op_files,
|
Add new parrots extension implementation for all ops (#794)
* delete all parrots file
add bbox_overlaps new parrots op impl
* support first new impl parrts op (bbox_overlaps)(success test)
* add box_iou_rotated op, test succeed
* add carafe and carafe_naive op, test succeed (one parrots bug need fix)
* add cc_attention op, test success
* add corner_pool op, test success
* add parrots op deform_conv, test success
* add deform_roi_pool op, test success (but has question)
* add focal loss op, test success (gradcheck)
* add masked_conv2d op, test success
* add modulated_deform_conv op, test success
* add nms and nms_rotated op, test success
* add psamask op, test success
* add roi_align op, test_success
* add roi_pool op, test success
* add sync_bn op, test success
* add tin_shift op, test success
* fix test_deform_roi_pool, add parrots test
* skip test_onnx because parrots does not support onnx
* fix c++ lint
* fix python lint
* fix python lint
2021-02-26 19:05:25 +08:00
|
|
|
include_dirs=include_dirs,
|
2020-07-07 01:00:37 +08:00
|
|
|
define_macros=define_macros,
|
Add new parrots extension implementation for all ops (#794)
* delete all parrots file
add bbox_overlaps new parrots op impl
* support first new impl parrts op (bbox_overlaps)(success test)
* add box_iou_rotated op, test succeed
* add carafe and carafe_naive op, test succeed (one parrots bug need fix)
* add cc_attention op, test success
* add corner_pool op, test success
* add parrots op deform_conv, test success
* add deform_roi_pool op, test success (but has question)
* add focal loss op, test success (gradcheck)
* add masked_conv2d op, test success
* add modulated_deform_conv op, test success
* add nms and nms_rotated op, test success
* add psamask op, test success
* add roi_align op, test_success
* add roi_pool op, test success
* add sync_bn op, test success
* add tin_shift op, test success
* fix test_deform_roi_pool, add parrots test
* skip test_onnx because parrots does not support onnx
* fix c++ lint
* fix python lint
* fix python lint
2021-02-26 19:05:25 +08:00
|
|
|
extra_compile_args=extra_compile_args,
|
|
|
|
cuda=True,
|
|
|
|
pytorch=True)
|
2020-07-07 01:00:37 +08:00
|
|
|
extensions.append(ext_ops)
|
|
|
|
elif EXT_TYPE == 'pytorch':
|
2020-06-28 23:15:47 +08:00
|
|
|
ext_name = 'mmcv._ext'
|
2021-01-06 11:05:19 +08:00
|
|
|
from torch.utils.cpp_extension import CppExtension, CUDAExtension
|
|
|
|
|
2020-07-07 01:00:37 +08:00
|
|
|
# prevent ninja from using too many resources
|
2021-08-18 19:37:18 +08:00
|
|
|
try:
|
|
|
|
import psutil
|
|
|
|
num_cpu = len(psutil.Process().cpu_affinity())
|
|
|
|
cpu_use = max(4, num_cpu - 1)
|
|
|
|
except (ModuleNotFoundError, AttributeError):
|
|
|
|
cpu_use = 4
|
|
|
|
|
|
|
|
os.environ.setdefault('MAX_JOBS', str(cpu_use))
|
2020-07-07 01:00:37 +08:00
|
|
|
define_macros = []
|
|
|
|
extra_compile_args = {'cxx': []}
|
2021-08-10 15:09:19 +08:00
|
|
|
include_dirs = []
|
2020-07-07 01:00:37 +08:00
|
|
|
|
2021-07-09 21:02:10 +08:00
|
|
|
is_rocm_pytorch = False
|
2021-08-10 16:17:59 +08:00
|
|
|
try:
|
2021-07-09 21:02:10 +08:00
|
|
|
from torch.utils.cpp_extension import ROCM_HOME
|
|
|
|
is_rocm_pytorch = True if ((torch.version.hip is not None) and
|
|
|
|
(ROCM_HOME is not None)) else False
|
2021-08-10 16:17:59 +08:00
|
|
|
except ImportError:
|
|
|
|
pass
|
2021-07-09 21:02:10 +08:00
|
|
|
|
2021-08-10 15:09:19 +08:00
|
|
|
project_dir = 'mmcv/ops/csrc/'
|
2021-07-09 21:02:10 +08:00
|
|
|
if is_rocm_pytorch:
|
|
|
|
from torch.utils.hipify import hipify_python
|
|
|
|
|
|
|
|
hipify_python.hipify(
|
2021-08-10 15:09:19 +08:00
|
|
|
project_directory=project_dir,
|
|
|
|
output_directory=project_dir,
|
2021-07-09 21:02:10 +08:00
|
|
|
includes='mmcv/ops/csrc/*',
|
|
|
|
show_detailed=True,
|
|
|
|
is_pytorch_extension=True,
|
|
|
|
)
|
|
|
|
define_macros += [('MMCV_WITH_CUDA', None)]
|
|
|
|
define_macros += [('HIP_DIFF', None)]
|
|
|
|
cuda_args = os.getenv('MMCV_CUDA_ARGS')
|
|
|
|
extra_compile_args['nvcc'] = [cuda_args] if cuda_args else []
|
|
|
|
op_files = glob.glob('./mmcv/ops/csrc/pytorch/hip/*')
|
|
|
|
extension = CUDAExtension
|
2021-08-10 15:09:19 +08:00
|
|
|
include_dirs.append(os.path.abspath('./mmcv/ops/csrc/common/hip'))
|
2021-07-09 21:02:10 +08:00
|
|
|
elif torch.cuda.is_available() or os.getenv('FORCE_CUDA', '0') == '1':
|
2020-07-07 01:00:37 +08:00
|
|
|
define_macros += [('MMCV_WITH_CUDA', None)]
|
2020-06-29 21:14:09 +08:00
|
|
|
cuda_args = os.getenv('MMCV_CUDA_ARGS')
|
2020-07-07 01:00:37 +08:00
|
|
|
extra_compile_args['nvcc'] = [cuda_args] if cuda_args else []
|
2021-08-10 15:09:19 +08:00
|
|
|
op_files = glob.glob('./mmcv/ops/csrc/pytorch/*.cpp') + \
|
|
|
|
glob.glob('./mmcv/ops/csrc/pytorch/cuda/*.cu')
|
2020-07-07 01:00:37 +08:00
|
|
|
extension = CUDAExtension
|
2021-08-10 15:09:19 +08:00
|
|
|
include_dirs.append(os.path.abspath('./mmcv/ops/csrc/common'))
|
|
|
|
include_dirs.append(os.path.abspath('./mmcv/ops/csrc/common/cuda'))
|
2020-06-28 23:15:47 +08:00
|
|
|
else:
|
2020-07-07 01:00:37 +08:00
|
|
|
print(f'Compiling {ext_name} without CUDA')
|
|
|
|
op_files = glob.glob('./mmcv/ops/csrc/pytorch/*.cpp')
|
|
|
|
extension = CppExtension
|
2021-08-10 15:09:19 +08:00
|
|
|
include_dirs.append(os.path.abspath('./mmcv/ops/csrc/common'))
|
2020-07-07 01:00:37 +08:00
|
|
|
|
|
|
|
ext_ops = extension(
|
|
|
|
name=ext_name,
|
|
|
|
sources=op_files,
|
2021-08-10 15:09:19 +08:00
|
|
|
include_dirs=include_dirs,
|
2020-07-07 01:00:37 +08:00
|
|
|
define_macros=define_macros,
|
|
|
|
extra_compile_args=extra_compile_args)
|
|
|
|
extensions.append(ext_ops)
|
2020-12-23 11:03:55 +08:00
|
|
|
|
|
|
|
if EXT_TYPE == 'pytorch' and os.getenv('MMCV_WITH_ORT', '0') != '0':
|
|
|
|
ext_name = 'mmcv._ext_ort'
|
|
|
|
from torch.utils.cpp_extension import library_paths, include_paths
|
|
|
|
import onnxruntime
|
|
|
|
library_dirs = []
|
|
|
|
libraries = []
|
|
|
|
include_dirs = []
|
|
|
|
ort_path = os.getenv('ONNXRUNTIME_DIR', '0')
|
|
|
|
library_dirs += [os.path.join(ort_path, 'lib')]
|
|
|
|
libraries.append('onnxruntime')
|
|
|
|
define_macros = []
|
|
|
|
extra_compile_args = {'cxx': []}
|
|
|
|
|
|
|
|
include_path = os.path.abspath('./mmcv/ops/csrc/onnxruntime')
|
|
|
|
include_dirs.append(include_path)
|
|
|
|
include_dirs.append(os.path.join(ort_path, 'include'))
|
|
|
|
|
|
|
|
op_files = glob.glob('./mmcv/ops/csrc/onnxruntime/cpu/*')
|
|
|
|
if onnxruntime.get_device() == 'GPU' or os.getenv('FORCE_CUDA',
|
|
|
|
'0') == '1':
|
|
|
|
define_macros += [('MMCV_WITH_CUDA', None)]
|
|
|
|
cuda_args = os.getenv('MMCV_CUDA_ARGS')
|
|
|
|
extra_compile_args['nvcc'] = [cuda_args] if cuda_args else []
|
|
|
|
op_files += glob.glob('./mmcv/ops/csrc/onnxruntime/gpu/*')
|
2021-04-17 12:16:40 +08:00
|
|
|
include_dirs += include_paths(cuda=True)
|
2020-12-23 11:03:55 +08:00
|
|
|
library_dirs += library_paths(cuda=True)
|
|
|
|
else:
|
2021-04-17 12:16:40 +08:00
|
|
|
include_dirs += include_paths(cuda=False)
|
2020-12-23 11:03:55 +08:00
|
|
|
library_dirs += library_paths(cuda=False)
|
|
|
|
|
|
|
|
from setuptools import Extension
|
|
|
|
ext_ops = Extension(
|
|
|
|
name=ext_name,
|
|
|
|
sources=op_files,
|
|
|
|
include_dirs=include_dirs,
|
|
|
|
define_macros=define_macros,
|
|
|
|
extra_compile_args=extra_compile_args,
|
|
|
|
language='c++',
|
|
|
|
library_dirs=library_dirs,
|
|
|
|
libraries=libraries)
|
|
|
|
extensions.append(ext_ops)
|
|
|
|
|
2020-06-28 23:15:47 +08:00
|
|
|
return extensions
|
|
|
|
|
2019-05-28 20:03:08 +08:00
|
|
|
|
2018-08-27 02:12:31 +08:00
|
|
|
setup(
|
2020-07-09 02:19:02 +08:00
|
|
|
name='mmcv' if os.getenv('MMCV_WITH_OPS', '0') == '0' else 'mmcv-full',
|
2018-08-27 02:12:31 +08:00
|
|
|
version=get_version(),
|
2020-06-28 23:15:47 +08:00
|
|
|
description='OpenMMLab Computer Vision Foundation',
|
2018-08-27 02:12:31 +08:00
|
|
|
keywords='computer vision',
|
|
|
|
packages=find_packages(),
|
2020-05-30 13:04:37 +08:00
|
|
|
include_package_data=True,
|
2018-08-27 02:12:31 +08:00
|
|
|
classifiers=[
|
|
|
|
'Development Status :: 4 - Beta',
|
2018-12-09 17:28:52 +08:00
|
|
|
'License :: OSI Approved :: Apache Software License',
|
2018-08-27 02:12:31 +08:00
|
|
|
'Operating System :: OS Independent',
|
|
|
|
'Programming Language :: Python :: 3',
|
|
|
|
'Programming Language :: Python :: 3.6',
|
2019-04-23 15:15:27 +08:00
|
|
|
'Programming Language :: Python :: 3.7',
|
2020-03-16 15:15:35 +08:00
|
|
|
'Programming Language :: Python :: 3.8',
|
2021-08-27 16:25:30 +08:00
|
|
|
'Programming Language :: Python :: 3.9',
|
2018-08-27 02:12:31 +08:00
|
|
|
'Topic :: Utilities',
|
|
|
|
],
|
|
|
|
url='https://github.com/open-mmlab/mmcv',
|
2021-09-01 19:20:01 +08:00
|
|
|
author='MMCV Contributors',
|
2020-07-21 14:48:16 +08:00
|
|
|
author_email='openmmlab@gmail.com',
|
2018-08-27 02:12:31 +08:00
|
|
|
setup_requires=['pytest-runner'],
|
|
|
|
tests_require=['pytest'],
|
|
|
|
install_requires=install_requires,
|
2020-06-28 23:15:47 +08:00
|
|
|
ext_modules=get_extensions(),
|
2020-12-13 19:43:25 +08:00
|
|
|
cmdclass=cmd_class,
|
2018-08-27 02:12:31 +08:00
|
|
|
zip_safe=False)
|