Skip to content

Commit

Permalink
[Docs] Add notice for default branch switching (#1693)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaotongxiao committed Jan 30, 2023
1 parent dff97ed commit bf41194
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 18 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ The main branch works with **PyTorch 1.6+**.

## Latest Updates

**The default branch has been switched to `1.x` from `main`, and we encourage
users to migrate to the latest version, though it comes with some cost. Please refer to [Migration Guide](https://mmocr.readthedocs.io/en/dev-1.x/migration/overview.html) for more
details.**

v1.0.0rc5 was released in 2023-01-06.

1. Two models, Aster and SVTR, are added to our model zoo. The full implementation of ABCNet is also available now.
Expand Down
5 changes: 3 additions & 2 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,16 @@ MMOCR 是基于 PyTorch 和 mmdetection 的开源工具箱,专注于文本检

-**模块化设计**

MMOCR 的模块化设计使用户可以定义自己的优化器,数据预处理器,模型组件如主干模块,颈部模块和头部模块,以及损失函数。有关如何构建自定义模型的信
息,请参考[概览](https://mmocr.readthedocs.io/zh_CN/dev-1.x/get_started/overview.html)
MMOCR 的模块化设计使用户可以定义自己的优化器,数据预处理器,模型组件如主干模块,颈部模块和头部模块,以及损失函数。有关如何构建自定义模型的信息,请参考[概览](https://mmocr.readthedocs.io/zh_CN/dev-1.x/get_started/overview.html)

-**众多实用工具**

该工具箱提供了一套全面的实用程序,可以帮助用户评估模型的性能。它包括可对图像,标注的真值以及预测结果进行可视化的可视化工具,以及用于在训练过程中评估模型的验证工具。它还包括数据转换器,演示了如何将用户自建的标注数据转换为 MMOCR 支持的标注文件。

## 近期更新

**默认分支已经从 `main` 切换到 `1.x`。我们鼓励用户迁移到最新版本,请参考 [迁移指南](https://mmocr.readthedocs.io/zh_CN/dev-1.x/migration/overview.html) 以了解更多细节。**

最新的版本 v1.0.0rc5 于 2023-01-06 发布。

1. 新增了 Aster 和 SVTR 模型,并完整支持了 ABCNet 的训练与测试;
Expand Down
2 changes: 1 addition & 1 deletion docs/en/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ You can switch between English and Chinese in the lower-left corner of the layou

.. toctree::
:maxdepth: 2
:caption: Migration Guides
:caption: Migrating from MMOCR 0.x

migration/overview.md
migration/code.md
Expand Down
10 changes: 5 additions & 5 deletions docs/en/migration/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

Along with the release of OpenMMLab 2.0, MMOCR 1.0 made many significant changes, resulting in less redundant, more efficient code and a more consistent overall design. However, these changes break backward compatibility. We understand that with such huge changes, it is not easy for users familiar with the old version to adapt to the new version. Therefore, we prepared a detailed migration guide to make the transition as smooth as possible so that all users can enjoy the productivity benefits of the new MMOCR and the entire OpenMMLab 2.0 ecosystem.

```{warning}
MMOCR 1.0 depends on the new foundational library for training deep learning models [MMEngine](https://github.com/open-mmlab/mmengine), and therefore has an entirely different dependency chain compared with MMOCR 0.x. Even if you have a well-rounded MMOCR 0.x environment before, you still need to create a new python environment for MMOCR 1.0. We provide a detailed [installation guide](../get_started/install.md) for reference.
```

Next, please read the sections according to your requirements.

- If you want to migrate a model trained in version 0.x to use it directly in version 1.0, please read [Pretrained Model Migration](./model.md).
- If you want to train the model, please read [Dataset Migration](./dataset.md) and [Data Transform Migration](./transforms.md).
- If you want to develop on MMOCR, please read [Code Migration](code.md) and [Upstream Library Changes](https://github.com/open-mmlab/mmengine/tree/main/docs/en/migration).

```{note}
It should be noted that MMOCR 1.0 depends on the new foundational library for training deep learning models [MMEngine](https://github.com/open-mmlab/mmengine). Therefore, you need to create a new python environment to install the dependencies for MMOCR 1.0. We provide a detailed [installation guide](../get_started/install.md) for reference.
```

As shown in the following figure, the maintenance plan of MMOCR 1.x version is mainly divided into three stages, namely "Public Beta Period", "Compatibility Period" and "Maintenance Period". For old versions, we will no longer add major new features. Therefore, we strongly recommend users to migrate to MMOCR 1.x version as soon as possible.
As shown in the following figure, the maintenance plan of MMOCR 1.x version is mainly divided into three stages, namely "RC Period", "Compatibility Period" and "Maintenance Period". For old versions, we will no longer add major new features. Therefore, we strongly recommend users to migrate to MMOCR 1.x version as soon as possible.

![plan](https://user-images.githubusercontent.com/45810070/192927112-70c0108d-58ed-4c77-8a0a-9d9685a48333.png)
2 changes: 1 addition & 1 deletion docs/zh_cn/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

.. toctree::
:maxdepth: 2
:caption: 迁移指南
:caption: MMOCR 0.x 迁移指南

migration/overview.md
migration/code.md
Expand Down
8 changes: 4 additions & 4 deletions docs/zh_cn/migration/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

伴随着 OpenMMLab 2.0 的发布,MMOCR 1.0 本身也作出了许多突破性的改变,使得代码的冗余度降低,代码效率提高,整体设计上也变得更为一致。然而,这些改变使得完美的后向兼容不再可能。我们也深知在这样巨大的变动之下,老用户想第一时间适应新版本也绝非易事。因此,我们推出了详细的迁移指南,旨在让老用户们尽可能平滑地过渡到全新的框架,最终能享受到全新的 MMOCR 和整个OpenMMLab 2.0 生态系统为生产力带来的巨大优势。

```{warning}
MMOCR 1.0 依赖于新的基础训练框架 [MMEngine](https://github.com/open-mmlab/mmengine),因而有着与 MMOCR 0.x 完全不同的依赖链。尽管你可能已经拥有了一个可以正常运行 MMOCR 0.x 的环境,但你仍然需要创建一个新的 python 环境来安装 MMOCR 1.0 版本所需要的依赖库。我们提供了详细的[安装文档](../get_started/install.md)以供参考。
```

接下来,请根据你的实际需求,阅读需要的章节:

- 如果你需要把 0.x 版本中训练的模型直接迁移到 1.0 版本中使用,请阅读 [预训练模型迁移](./model.md)
- 如果你需要训练模型,请阅读 [数据集迁移](./dataset.md)[数据增强迁移](./transforms.md)
- 如果你需要在 MMOCR 上进行开发,请阅读 [代码迁移](code.md)[上游依赖库变更](https://github.com/open-mmlab/mmengine/tree/main/docs/zh_cn/migration)

```{note}
需要注意的是,MMOCR 1.0 依赖于新的基础训练框架 [MMEngine](https://github.com/open-mmlab/mmengine)。因此,你需要创建新的 python 环境来安装 MMOCR 1.0 版本所需要的依赖库。我们提供了详细的[安装文档](../get_started/install.md)以供参考。
```

如下图所示,MMOCR 1.x 版本的维护计划主要分为三个阶段,即“公测期”,“兼容期”以及“维护期”。对于旧版本,我们将不再增加主要新功能。因此,我们强烈建议用户尽早迁移至 MMOCR 1.x 版本。

![plan](https://user-images.githubusercontent.com/45810070/192678159-f8965f73-552b-48a1-bf65-659e8f519bdd.png)
25 changes: 20 additions & 5 deletions mmocr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,32 @@

import mmcv
import mmdet
import mmengine
from mmengine.utils import digit_version

try:
import mmengine
from mmengine.utils import digit_version
except ImportError:
mmengine = None
from mmcv import digit_version

from .version import __version__, short_version

mmcv_minimum_version = '2.0.0rc1'
mmcv_maximum_version = '2.1.0'
mmcv_version = digit_version(mmcv.__version__)
mmengine_minimum_version = '0.1.0'
mmengine_maximum_version = '1.0.0'
mmengine_version = digit_version(mmengine.__version__)
if mmengine is not None:
mmengine_minimum_version = '0.1.0'
mmengine_maximum_version = '1.0.0'
mmengine_version = digit_version(mmengine.__version__)

if mmcv_version < digit_version('2.0.0rc0') or mmdet.__version__ < '3.0.0rc0':
raise RuntimeError(
'MMOCR 1.0 only runs with MMEngine, MMCV 2.0.0rc0+ and '
'MMDetection 3.0.0rc0+, but got MMCV '
f'{mmcv.__version__} and MMDetection '
f'{mmdet.__version__}. For more information, please refer to '
'https://mmocr.readthedocs.io/en/dev-1.x/migration/overview.html'
) # noqa

assert (mmcv_version >= digit_version(mmcv_minimum_version)
and mmcv_version < digit_version(mmcv_maximum_version)), \
Expand Down

0 comments on commit bf41194

Please sign in to comment.