Skip to content

Commit

Permalink
Rename mmcv package name (#2235)
Browse files Browse the repository at this point in the history
* Rename mmcv package name

* fix typo

* fix typo

* fix typo
  • Loading branch information
zhouzaida committed Aug 30, 2022
1 parent 040658b commit 57ba481
Show file tree
Hide file tree
Showing 12 changed files with 213 additions and 225 deletions.
10 changes: 5 additions & 5 deletions .dev_scripts/check_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


def check_installation():
"""Check whether mmcv-full has been installed successfully."""
"""Check whether mmcv has been installed successfully."""
np_boxes1 = np.asarray(
[[1.0, 1.0, 3.0, 4.0, 0.5], [2.0, 2.0, 3.0, 4.0, 0.6],
[7.0, 7.0, 8.0, 8.0, 0.4]],
Expand All @@ -18,11 +18,11 @@ def check_installation():
boxes1 = torch.from_numpy(np_boxes1)
boxes2 = torch.from_numpy(np_boxes2)

# test mmcv-full with CPU ops
# test mmcv with CPU ops
box_iou_rotated(boxes1, boxes2)
print('CPU ops were compiled successfully.')

# test mmcv-full with both CPU and CUDA ops
# test mmcv with both CPU and CUDA ops
if torch.cuda.is_available():
boxes1 = boxes1.cuda()
boxes2 = boxes2.cuda()
Expand All @@ -33,9 +33,9 @@ def check_installation():


if __name__ == '__main__':
print('Start checking the installation of mmcv-full ...')
print('Start checking the installation of mmcv ...')
check_installation()
print('mmcv-full has been installed successfully.\n')
print('mmcv has been installed successfully.\n')

env_info_dict = collect_env()
env_info = '\n'.join([(f'{k}: {v}') for k, v in env_info_dict.items()])
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ jobs:
run: pip install psutil
- name: Create sdist and untar
run: |
MMCV_WITH_OPS=1 python setup.py sdist
tar zxvf dist/mmcv-full* -C /tmp
python setup.py sdist
tar zxvf dist/mmcv* -C /tmp
rm -r mmcv
- name: Build and install from sdist
run: |
pushd /tmp/mmcv-full*
pushd /tmp/mmcv*
pip install -e .
popd
- name: Validate the installation
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ jobs:
- name: Upgrade Setuptools
run: pip install setuptools --upgrade
- name: Build MMCV
run: python setup.py sdist
run: |
sed -i "s/os.getenv('MMCV_WITH_OPS', '1')/os.getenv('MMCV_WITH_OPS', '0')/g" setup.py
python setup.py sdist
- name: Publish distribution to PyPI
run: |
pip install twine
Expand All @@ -37,9 +39,7 @@ jobs:
- name: Upgrade Setuptools
run: pip install setuptools --upgrade
- name: Build MMCV with ops
run: |
sed -i "s/os.getenv('MMCV_WITH_OPS', '0')/os.getenv('MMCV_WITH_OPS', '1')/g" setup.py
python setup.py sdist
run: python setup.py sdist
- name: Publish distribution to PyPI
run: |
pip install twine
Expand Down
94 changes: 46 additions & 48 deletions README.md

Large diffs are not rendered by default.

98 changes: 48 additions & 50 deletions README_zh-CN.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Docker images

There are two `Dockerfile` files to build docker images, one to build an image with the mmcv-full pre-built package and the other with the mmcv development environment.
There are two `Dockerfile` files to build docker images, one to build an image with the mmcv pre-built package and the other with the mmcv development environment.

```text
.
Expand Down Expand Up @@ -28,7 +28,7 @@ Or build with remote repository
docker build -t mmcv https://github.com/open-mmlab/mmcv.git#master:docker/release
```

The [Dockerfile](release/Dockerfile) installs latest released version of mmcv-full by default, but you can specify mmcv versions to install expected versions.
The [Dockerfile](release/Dockerfile) installs latest released version of mmcv by default, but you can specify mmcv versions to install expected versions.

```bash
docker image build -t mmcv -f docker/release/Dockerfile --build-arg MMCV=1.5.0 .
Expand Down
3 changes: 1 addition & 2 deletions docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ RUN apt-get install -y ffmpeg libturbojpeg \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# build mmcv-full from source with develop mode
# build mmcv from source with develop mode
ARG HTTPS_PROXY=""
ENV https_proxy=${HTTPS_PROXY}
ENV FORCE_CUDA="1"
ENV MMCV_WITH_OPS="1"
ARG CUDA_ARCH=""
ENV TORCH_CUDA_ARCH_LIST=${CUDA_ARCH}
RUN git clone https://github.com/open-mmlab/mmcv.git /mmcv
Expand Down
6 changes: 3 additions & 3 deletions docker/release/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install mmcv-full
ARG MMCV="1.5.1"
RUN pip install openmim && mim install mmcv-full==${MMCV} && python -c 'import mmcv;print(mmcv.__version__)'
# Install mmcv
ARG MMCV="2.0.0rc1"
RUN pip install openmim && mim install mmcv==${MMCV} && python -c 'import mmcv;print(mmcv.__version__)'
100 changes: 48 additions & 52 deletions docs/en/get_started/installation.md

Large diffs are not rendered by default.

102 changes: 49 additions & 53 deletions docs/zh_cn/get_started/installation.md

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion mmcv/cnn/bricks/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
except ImportError:
warnings.warn('Fail to import ``MultiScaleDeformableAttention`` from '
'``mmcv.ops.multi_scale_deform_attn``, '
'You should install ``mmcv-full`` if you need this module. ')
'You should install ``mmcv`` rather than ``mmcv-lite`` '
'if you need this module. ')


def build_positional_encoding(cfg, default_args=None):
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def gen_packages_items():
def get_extensions():
extensions = []

if os.getenv('MMCV_WITH_OPS', '0') == '0':
if os.getenv('MMCV_WITH_OPS', '1') == '0':
return extensions

if EXT_TYPE == 'parrots':
Expand Down Expand Up @@ -297,7 +297,7 @@ def get_extensions():


setup(
name='mmcv' if os.getenv('MMCV_WITH_OPS', '0') == '0' else 'mmcv-full',
name='mmcv' if os.getenv('MMCV_WITH_OPS', '1') == '1' else 'mmcv-lite',
version=get_version(),
description='OpenMMLab Computer Vision Foundation',
keywords='computer vision',
Expand Down

0 comments on commit 57ba481

Please sign in to comment.