Skip to content

Commit bf41194

Browse files
authored
[Docs] Add notice for default branch switching (#1693)
1 parent dff97ed commit bf41194

File tree

7 files changed

+38
-18
lines changed

7 files changed

+38
-18
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ The main branch works with **PyTorch 1.6+**.
7171

7272
## Latest Updates
7373

74+
**The default branch has been switched to `1.x` from `main`, and we encourage
75+
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
76+
details.**
77+
7478
v1.0.0rc5 was released in 2023-01-06.
7579

7680
1. Two models, Aster and SVTR, are added to our model zoo. The full implementation of ABCNet is also available now.

README_zh-CN.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,16 @@ MMOCR 是基于 PyTorch 和 mmdetection 的开源工具箱,专注于文本检
6363

6464
-**模块化设计**
6565

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

6968
-**众多实用工具**
7069

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

7372
## 近期更新
7473

74+
**默认分支已经从 `main` 切换到 `1.x`。我们鼓励用户迁移到最新版本,请参考 [迁移指南](https://mmocr.readthedocs.io/zh_CN/dev-1.x/migration/overview.html) 以了解更多细节。**
75+
7576
最新的版本 v1.0.0rc5 于 2023-01-06 发布。
7677

7778
1. 新增了 Aster 和 SVTR 模型,并完整支持了 ABCNet 的训练与测试;

docs/en/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ You can switch between English and Chinese in the lower-left corner of the layou
3939

4040
.. toctree::
4141
:maxdepth: 2
42-
:caption: Migration Guides
42+
:caption: Migrating from MMOCR 0.x
4343

4444
migration/overview.md
4545
migration/code.md

docs/en/migration/overview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
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.
44

5+
```{warning}
6+
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.
7+
```
8+
59
Next, please read the sections according to your requirements.
610

711
- 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).
812
- If you want to train the model, please read [Dataset Migration](./dataset.md) and [Data Transform Migration](./transforms.md).
913
- 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).
1014

11-
```{note}
12-
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.
13-
```
14-
15-
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.
15+
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.
1616

1717
![plan](https://user-images.githubusercontent.com/45810070/192927112-70c0108d-58ed-4c77-8a0a-9d9685a48333.png)

docs/zh_cn/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
.. toctree::
4141
:maxdepth: 2
42-
:caption: 迁移指南
42+
:caption: MMOCR 0.x 迁移指南
4343

4444
migration/overview.md
4545
migration/code.md

docs/zh_cn/migration/overview.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

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

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

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

11-
```{note}
12-
需要注意的是,MMOCR 1.0 依赖于新的基础训练框架 [MMEngine](https://github.com/open-mmlab/mmengine)。因此,你需要创建新的 python 环境来安装 MMOCR 1.0 版本所需要的依赖库。我们提供了详细的[安装文档](../get_started/install.md)以供参考。
13-
```
14-
1515
如下图所示,MMOCR 1.x 版本的维护计划主要分为三个阶段,即“公测期”,“兼容期”以及“维护期”。对于旧版本,我们将不再增加主要新功能。因此,我们强烈建议用户尽早迁移至 MMOCR 1.x 版本。
1616

1717
![plan](https://user-images.githubusercontent.com/45810070/192678159-f8965f73-552b-48a1-bf65-659e8f519bdd.png)

mmocr/__init__.py

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,32 @@
22

33
import mmcv
44
import mmdet
5-
import mmengine
6-
from mmengine.utils import digit_version
5+
6+
try:
7+
import mmengine
8+
from mmengine.utils import digit_version
9+
except ImportError:
10+
mmengine = None
11+
from mmcv import digit_version
712

813
from .version import __version__, short_version
914

1015
mmcv_minimum_version = '2.0.0rc1'
1116
mmcv_maximum_version = '2.1.0'
1217
mmcv_version = digit_version(mmcv.__version__)
13-
mmengine_minimum_version = '0.1.0'
14-
mmengine_maximum_version = '1.0.0'
15-
mmengine_version = digit_version(mmengine.__version__)
18+
if mmengine is not None:
19+
mmengine_minimum_version = '0.1.0'
20+
mmengine_maximum_version = '1.0.0'
21+
mmengine_version = digit_version(mmengine.__version__)
22+
23+
if mmcv_version < digit_version('2.0.0rc0') or mmdet.__version__ < '3.0.0rc0':
24+
raise RuntimeError(
25+
'MMOCR 1.0 only runs with MMEngine, MMCV 2.0.0rc0+ and '
26+
'MMDetection 3.0.0rc0+, but got MMCV '
27+
f'{mmcv.__version__} and MMDetection '
28+
f'{mmdet.__version__}. For more information, please refer to '
29+
'https://mmocr.readthedocs.io/en/dev-1.x/migration/overview.html'
30+
) # noqa
1631

1732
assert (mmcv_version >= digit_version(mmcv_minimum_version)
1833
and mmcv_version < digit_version(mmcv_maximum_version)), \

0 commit comments

Comments
 (0)