Skip to content

Instantly share code, notes, and snippets.

@zachlewis
Created December 7, 2020 23:23
Show Gist options
  • Save zachlewis/6031c95e8577896a60676f72985d02b3 to your computer and use it in GitHub Desktop.
Save zachlewis/6031c95e8577896a60676f72985d02b3 to your computer and use it in GitHub Desktop.
mmdetection rez package
name = 'mmdetection'
version = '2.3.0.z0'
description = \
'''
MMDetection is an open source object detection toolbox based on PyTorch.
It is a part of the OpenMMLab project developed by Multimedia Laboratory, CUHK.
'''
authors = ['open-mmlab']
help = 'https://{this.name}.readthedocs.io/en/latest/'
@early()
def variants():
from rez.package_py_utils import expand_requires
requires = ["platform-**", "arch-**", "os-**"]
pythons = [
'python-3.7.*',
]
#cudas = [
#'cuda-10.1',
#'cuda-10.2',
#'cuda-11.0',
#'!cuda',
#]
return [expand_requires(*requires + [python]) for python in pythons]
hashed_variants = True
requires = [
'matplotlib',
'numpy',
'PyYAML',
'pycocotools',
'six',
'terminaltables',
'mmcv',
'imagecorruptions',
'albumentations-0.3.2+',
'lvis',
'cityscapesScripts',
]
private_build_requires = [
'pip-19+',
'llvm-8',
'git',
'dvc',
'Cython',
]
def commands():
python_ver = resolve.python.version
env.PATH.prepend('{root}/bin')
env.PYTHONPATH.prepend(
'{root}/lib/python{python_ver.major}.{python_ver.minor}/site-packages'
)
alias('mmdet_clone_repo', 'git clone https://github.com/open-mmlab/mmdetection.git .')
@early()
def uuid():
import uuid
return str(uuid.uuid5(uuid.NAMESPACE_DNS, name))
def pre_build_commands():
env.PYTHONUSERBASE = build.install_path
env.MMCV_WITH_OPS = 1 if 'cuda' in resolve else 0
ver = '.'.join(map(str, this.version[0:3]))
releases = ['2.2.1', '2.2.0', '2.1.0', '2.0.0', '1.2.0', '1.1.0', '1.0.0' ] # etc... see upstream repo
env.GIT_TAG = 'master' if ver not in releases else 'v{ver}'
build_command = \
"""
git clone --branch=$GIT_TAG https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install . --no-deps --user --no-compile
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment