[Docs] Mark projects in docs (#1766)

* [Docs] Mark projects in docs

* fix

* fix

* fix

* fix
pull/1781/head
Tong Gao 2023-03-10 15:09:37 +08:00 committed by GitHub
parent 590af4b5e8
commit 465316f193
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 205 additions and 61 deletions

View File

@ -198,6 +198,10 @@ Supported algorithms:
Please refer to [model_zoo](https://mmocr.readthedocs.io/en/dev-1.x/modelzoo.html) for more details.
## Projects
[Here](projects/README.md) are some implementations of SOTA models and solutions built on MMOCR, which are supported and maintained by community users. These projects demonstrate the best practices based on MMOCR for research and product development. We welcome and appreciate all the contributions to OpenMMLab ecosystem.
## Contributing
We appreciate all contributions to improve MMOCR. Please refer to [CONTRIBUTING.md](.github/CONTRIBUTING.md) for the contributing guidelines.
@ -224,7 +228,7 @@ If you find this project useful in your research, please consider cite:
This project is released under the [Apache 2.0 license](LICENSE).
## Projects in OpenMMLab
## OpenMMLab Family
- [MMEngine](https://github.com/open-mmlab/mmengine): OpenMMLab foundational library for training deep learning models
- [MMCV](https://github.com/open-mmlab/mmcv): OpenMMLab foundational library for computer vision.

View File

@ -188,6 +188,11 @@ pip3 install -e .
请点击[模型库](https://mmocr.readthedocs.io/zh_CN/dev-1.x/modelzoo.html)查看更多关于上述算法的详细信息。
## 社区项目
[这里](projects/README.md)有一些由社区用户支持和维护的基于 MMOCR 的 SOTA 模型和解决方案的实现。这些项目展示了基于 MMOCR 的研究和产品开发的最佳实践。
我们欢迎并感谢对 OpenMMLab 生态系统的所有贡献。
## 贡献指南
我们感谢所有的贡献者为改进和提升 MMOCR 所作出的努力。请参考[贡献指南](.github/CONTRIBUTING.md)来了解参与项目贡献的相关指引。

View File

@ -1 +1 @@
var collapsedSections = ['Migration Guides', 'Dataset Zoo', 'Model Zoo', 'Notes', 'API Reference']
var collapsedSections = ['Migration Guides', 'API Reference']

View File

@ -180,6 +180,7 @@ def builder_inited_handler(app):
subprocess.run(['./merge_docs.sh'])
subprocess.run(['./stats.py'])
subprocess.run(['./dataset_zoo.py'])
subprocess.run(['./project_zoo.py'])
def setup(app):

View File

@ -38,15 +38,6 @@ You can switch between English and Chinese in the lower-left corner of the layou
basic_concepts/convention.md
basic_concepts/engine.md
.. toctree::
:maxdepth: 2
:caption: Migrating from MMOCR 0.x
migration/overview.md
migration/code.md
migration/dataset.md
migration/model.md
migration/transforms.md
.. toctree::
:maxdepth: 2
@ -63,6 +54,7 @@ You can switch between English and Chinese in the lower-left corner of the layou
:caption: Model Zoo
modelzoo.md
projectzoo.md
backbones.md
textdet_models.md
textrecog_models.md
@ -73,9 +65,18 @@ You can switch between English and Chinese in the lower-left corner of the layou
:caption: Notes
notes/contribution_guide.md
notes/projects.md
notes/changelog.md
.. toctree::
:maxdepth: 2
:caption: Migrating from MMOCR 0.x
migration/overview.md
migration/code.md
migration/dataset.md
migration/model.md
migration/transforms.md
.. toctree::
:maxdepth: 1
:caption: API Reference

View File

@ -1 +0,0 @@
# Projects

View File

@ -0,0 +1,52 @@
#!/usr/bin/env python
import os.path as osp
import re
# This script reads /projects/selected.txt and generate projectzoo.md
files = []
project_zoo = """
# SOTA Models
Here are some selected project implementations that are not yet included in
MMOCR package, but are ready to use.
"""
files = open('../../projects/selected.txt').readlines()
for file in files:
file = file.strip()
with open(osp.join('../../', file)) as f:
content = f.read()
# Extract title
expr = '# (.*?)\n'
title = re.search(expr, content).group(1)
project_zoo += f'## {title}\n\n'
# Locate the description
expr = '## Description\n(.*?)##'
description = re.search(expr, content, re.DOTALL).group(1)
project_zoo += f'{description}\n'
# check milestone 1
expr = r'- \[(.?)\] Milestone 1'
state = re.search(expr, content, re.DOTALL).group(1)
infer_state = '' if state == 'x' else ''
# check milestone 2
expr = r'- \[(.?)\] Milestone 2'
state = re.search(expr, content, re.DOTALL).group(1)
training_state = '' if state == 'x' else ''
# add table
readme_link = f'https://github.com/open-mmlab/mmocr/blob/dev-1.x/{file}'
project_zoo += '### Status \n'
project_zoo += '| Inference | Train | README |\n'
project_zoo += '| --------- | -------- | ------ |\n'
project_zoo += f'|{infer_state}|{training_state}|[link]({readme_link})|\n'
with open('projectzoo.md', 'w') as f:
f.write(project_zoo)

View File

@ -1 +1 @@
var collapsedSections = ['迁移指南', '数据集支持', '模型支持', '记录', 'API文档']
var collapsedSections = ['MMOCR 0.x 迁移指南', 'API 文档']

View File

@ -177,6 +177,7 @@ def builder_inited_handler(app):
subprocess.run(['./merge_docs.sh'])
subprocess.run(['./stats.py'])
subprocess.run(['./dataset_zoo.py'])
subprocess.run(['./project_zoo.py'])
def setup(app):

View File

@ -28,25 +28,16 @@
:caption: 基础概念
basic_concepts/structures.md
basic_concepts/models.md
basic_concepts/transforms.md
basic_concepts/evaluation.md
basic_concepts/overview.md
basic_concepts/data_flow.md
basic_concepts/datasets.md
basic_concepts/transforms.md
basic_concepts/models.md
basic_concepts/visualizers.md
basic_concepts/convention.md
basic_concepts/engine.md
.. toctree::
:maxdepth: 2
:caption: MMOCR 0.x 迁移指南
migration/overview.md
migration/code.md
migration/dataset.md
migration/model.md
migration/transforms.md
.. toctree::
:maxdepth: 2
@ -63,6 +54,7 @@
:caption: 模型支持
modelzoo.md
projectzoo.md
backbones.md
textdet_models.md
textrecog_models.md
@ -70,12 +62,21 @@
.. toctree::
:maxdepth: 2
:caption: 记录
:caption: 其它
notes/contribution_guide.md
notes/projects.md
notes/changelog.md
.. toctree::
:maxdepth: 2
:caption: MMOCR 0.x 迁移指南
migration/overview.md
migration/code.md
migration/dataset.md
migration/model.md
migration/transforms.md
.. toctree::
:maxdepth: 2
:caption: API 文档

View File

@ -1 +0,0 @@
# 项目

View File

@ -0,0 +1,51 @@
#!/usr/bin/env python
import os.path as osp
import re
# This script reads /projects/selected.txt and generate projectzoo.md
files = []
project_zoo = """
# 前沿模型
这里是一些已经复现但是尚未包含在 MMOCR 包中的前沿模型
"""
files = open('../../projects/selected.txt').readlines()
for file in files:
file = file.strip()
with open(osp.join('../../', file)) as f:
content = f.read()
# Extract title
expr = '# (.*?)\n'
title = re.search(expr, content).group(1)
project_zoo += f'## {title}\n\n'
# Locate the description
expr = '## Description\n(.*?)##'
description = re.search(expr, content, re.DOTALL).group(1)
project_zoo += f'{description}\n'
# check milestone 1
expr = r'- \[(.?)\] Milestone 1'
state = re.search(expr, content, re.DOTALL).group(1)
infer_state = '' if state == 'x' else ''
# check milestone 2
expr = r'- \[(.?)\] Milestone 2'
state = re.search(expr, content, re.DOTALL).group(1)
training_state = '' if state == 'x' else ''
# add table
readme_link = f'https://github.com/open-mmlab/mmocr/blob/dev-1.x/{file}'
project_zoo += '### 模型状态 \n'
project_zoo += '| 推理 | 训练 | README |\n'
project_zoo += '| --------- | -------- | ------ |\n'
project_zoo += f'|{infer_state}|{training_state}|[link]({readme_link})|\n'
with open('projectzoo.md', 'w') as f:
f.write(project_zoo)

View File

@ -1,4 +1,4 @@
c# 数据准备 (Beta)
# 数据准备 (Beta)
```{note}
Dataset Preparer 目前仍处在公测阶段,欢迎尝鲜试用!如遇到任何问题,请及时向我们反馈。

View File

@ -1,4 +1,4 @@
# ABCNet: Real-time Scene Text Spotting with Adaptive Bezier-Curve Network
# ABCNet v2: Adaptive Bezier-Curve Network for Real-time End-to-end Text Spotting
<div>
<a href="https://arxiv.org/abs/2105.03620">[arXiv paper]</a>

View File

@ -1,9 +1,13 @@
# Projects
Implementing new models and features into OpenMMLab's algorithm libraries could be troublesome due to the rigorous requirements on code quality, which could hinder the fast iteration of SOTA models and might discourage our members from sharing their latest outcome here.
The OpenMMLab ecosystem can only grow through the contributions of the community.
Everyone is welcome to post their implementation of any great ideas in this folder! If you wish to start your own project, please go through the [example project](example_project/) for the best practice. For common questions about projects, please read our [faq](faq.md).
And that's why we have this `Projects/` folder now, where some experimental features, frameworks and models are placed, only needed to satisfy the minimum requirement on the code quality, and can be used as standalone libraries. Users are welcome to use them if they [use MMOCR from source](https://mmocr.readthedocs.io/en/dev-1.x/get_started/install.html#best-practices).
## External Projects
Everyone is welcome to post their implementation of any great ideas in this folder! If you wish to start your own project, please go through the [example project](example_project/) for the best practice.
Here we lists some selected external projects released in the community built upon MMOCR:
- [TableMASTER-mmocr](https://github.com/JiaquanYe/TableMASTER-mmocr)
- [WordArt](https://github.com/xdxie/WordArt)
Note: The core maintainers of MMOCR only ensure the results are reproducible and the code quality meets its claim at the time each project was submitted, but they may not be responsible for future maintenance. The original authors take responsibility for maintaining their own projects.

View File

@ -1,20 +1,22 @@
# Dummy ResNet Wrapper
This is an example README for community `projects/`. We have provided detailed explanations for each field in the form of html comments, which are visible when you read the source of this README file. If you wish to submit your project to our main repository, then all the fields in this README are mandatory for others to understand what you have achieved in this implementation. For more details, read our [contribution guide](https://mmocr.readthedocs.io/en/dev-1.x/notes/contribution_guide.html) or approach us in [Discussions](https://github.com/open-mmlab/mmocr/discussions).
> This is a README template for community `projects/`.
> All the fields in this README are **mandatory** for others to understand what you have achieved in this implementation. If you still feel unclear about the requirements, please read our [contribution guide](https://mmocr.readthedocs.io/en/dev-1.x/notes/contribution_guide.html), [projects FAQ](../faq.md), or approach us in [Discussions](https://github.com/open-mmlab/mmocr/discussions).
## Description
<!-- Share any information you would like others to know. For example:
Author: @xxx.
This is an implementation of \[XXX\]. -->
> Share any information you would like others to know. For example:
>
> Author: @xxx.
>
> This is an implementation of \[XXX\].
This project implements a dummy ResNet wrapper, which literally does nothing new but prints "hello world" during initialization.
## Usage
<!-- For a typical model, this section should contain the commands for training and testing. You are also suggested to dump your environment specification to env.yml by `conda env export > env.yml`. -->
> For a typical model, this section should contain the commands for training and testing. You are also suggested to dump your environment specification to env.yml by `conda env export > env.yml`.
### Prerequisites
@ -56,9 +58,9 @@ mim test mmocr configs/dbnet_dummy-resnet_fpnc_1200e_icdar2015.py --work-dir wor
## Results
<!-- List the results as usually done in other model's README. [Example](https://github.com/open-mmlab/mmocr/blob/1.x/configs/textdet/dbnet/README.md#results-and-models)
You should claim whether this is based on the pre-trained weights, which are converted from the official release; or it's a reproduced result obtained from retraining the model in this project. -->
> List the results as usually done in other model's README. [Example](https://github.com/open-mmlab/mmocr/blob/1.x/configs/textdet/dbnet/README.md#results-and-models)
>
> You should claim whether this is based on the pre-trained weights, which are converted from the official release; or it's a reproduced result obtained from retraining the model in this project.
| Method | Backbone | Pretrained Model | Training set | Test set | #epoch | Test size | Precision | Recall | Hmean | Download |
| :---------------------------------------------------------------: | :---------: | :--------------: | :-------------: | :------------: | :----: | :-------: | :-------: | :----: | :----: | :----------------------: |
@ -66,7 +68,7 @@ You should claim whether this is based on the pre-trained weights, which are con
## Citation
<!-- You may remove this section if not applicable. -->
> You may remove this section if not applicable.
```bibtex
@software{MMOCR_Contributors_OpenMMLab_Text_Detection_2020,
@ -84,58 +86,58 @@ year = {2020}
Here is a checklist illustrating a usual development workflow of a successful project, and also serves as an overview of this project's progress.
<!-- The PIC (person in charge) or contributors of this project should check all the items that they believe have been finished, which will further be verified by codebase maintainers via a PR.
OpenMMLab's maintainer will review the code to ensure the project's quality. Reaching the first milestone means that this project suffices the minimum requirement of being merged into 'projects/'. But this project is only eligible to become a part of the core package upon attaining the last milestone.
Note that keeping this section up-to-date is crucial not only for this project's developers but the entire community, since there might be some other contributors joining this project and deciding their starting point from this list. It also helps maintainers accurately estimate time and effort on further code polishing, if needed.
A project does not necessarily have to be finished in a single PR, but it's essential for the project to at least reach the first milestone in its very first PR. -->
> The PIC (person in charge) or contributors of this project should check all the items that they believe have been finished, which will further be verified by codebase maintainers via a PR.
>
> OpenMMLab's maintainer will review the code to ensure the project's quality. Reaching the first milestone means that this project suffices the minimum requirement of being merged into 'projects/'. But this project is only eligible to become a part of the core package upon attaining the last milestone.
>
> Note that keeping this section up-to-date is crucial not only for this project's developers but the entire community, since there might be some other contributors joining this project and deciding their starting point from this list. It also helps maintainers accurately estimate time and effort on further code polishing, if needed.
>
> A project does not necessarily have to be finished in a single PR, but it's essential for the project to at least reach the first milestone in its very first PR.
- [ ] Milestone 1: PR-ready, and acceptable to be one of the `projects/`.
- [ ] Finish the code
<!-- The code's design shall follow existing interfaces and convention. For example, each model component should be registered into `mmocr.registry.MODELS` and configurable via a config file. -->
> The code's design shall follow existing interfaces and convention. For example, each model component should be registered into `mmocr.registry.MODELS` and configurable via a config file.
- [ ] Basic docstrings & proper citation
<!-- Each major object should contain a docstring, describing its functionality and arguments. If you have adapted the code from other open-source projects, don't forget to cite the source project in docstring and make sure your behavior is not against its license. Typically, we do not accept any code snippet under GPL license. [A Short Guide to Open Source Licenses](https://medium.com/nationwide-technology/a-short-guide-to-open-source-licenses-cf5b1c329edd) -->
> Each major object should contain a docstring, describing its functionality and arguments. If you have adapted the code from other open-source projects, don't forget to cite the source project in docstring and make sure your behavior is not against its license. Typically, we do not accept any code snippet under GPL license. [A Short Guide to Open Source Licenses](https://medium.com/nationwide-technology/a-short-guide-to-open-source-licenses-cf5b1c329edd)
- [ ] Test-time correctness
<!-- If you are reproducing the result from a paper, make sure your model's inference-time performance matches that in the original paper. The weights usually could be obtained by simply renaming the keys in the official pre-trained weights. This test could be skipped though, if you are able to prove the training-time correctness and check the second milestone. -->
> If you are reproducing the result from a paper, make sure your model's inference-time performance matches that in the original paper. The weights usually could be obtained by simply renaming the keys in the official pre-trained weights. This test could be skipped though, if you are able to prove the training-time correctness and check the second milestone.
- [ ] A full README
<!-- As this template does. -->
> As this template does.
- [ ] Milestone 2: Indicates a successful model implementation.
- [ ] Training-time correctness
<!-- If you are reproducing the result from a paper, checking this item means that you should have trained your model from scratch based on the original paper's specification and verified that the final result matches the report within a minor error range. -->
> If you are reproducing the result from a paper, checking this item means that you should have trained your model from scratch based on the original paper's specification and verified that the final result matches the report within a minor error range.
- [ ] Milestone 3: Good to be a part of our core package!
- [ ] Type hints and docstrings
<!-- Ideally *all* the methods should have [type hints](https://www.pythontutorial.net/python-basics/python-type-hints/) and [docstrings](https://google.github.io/styleguide/pyguide.html#381-docstrings). [Example](https://github.com/open-mmlab/mmocr/blob/76637a290507f151215d299707c57cea5120976e/mmocr/utils/polygon_utils.py#L80-L96) -->
> Ideally *all* the methods should have [type hints](https://www.pythontutorial.net/python-basics/python-type-hints/) and [docstrings](https://google.github.io/styleguide/pyguide.html#381-docstrings). [Example](https://github.com/open-mmlab/mmocr/blob/76637a290507f151215d299707c57cea5120976e/mmocr/utils/polygon_utils.py#L80-L96)
- [ ] Unit tests
<!-- Unit tests for each module are required. [Example](https://github.com/open-mmlab/mmocr/blob/76637a290507f151215d299707c57cea5120976e/tests/test_utils/test_polygon_utils.py#L97-L106) -->
> Unit tests for each module are required. [Example](https://github.com/open-mmlab/mmocr/blob/76637a290507f151215d299707c57cea5120976e/tests/test_utils/test_polygon_utils.py#L97-L106)
- [ ] Code polishing
<!-- Refactor your code according to reviewer's comment. -->
> Refactor your code according to reviewer's comment.
- [ ] Metafile.yml
<!-- It will be parsed by MIM and Inferencer. [Example](https://github.com/open-mmlab/mmocr/blob/1.x/configs/textdet/dbnet/metafile.yml) -->
> It will be parsed by MIM and Inferencer. [Example](https://github.com/open-mmlab/mmocr/blob/1.x/configs/textdet/dbnet/metafile.yml)
- [ ] Move your modules into the core package following the codebase's file hierarchy structure.
<!-- In particular, you may have to refactor this README into a standard one. [Example](/configs/textdet/dbnet/README.md) -->
> In particular, you may have to refactor this README into a standard one. [Example](/configs/textdet/dbnet/README.md)
- [ ] Refactor your modules into the core package following the codebase's file hierarchy structure.

21
projects/faq.md 100644
View File

@ -0,0 +1,21 @@
# Projects FAQ
Q1: Why set up `projects/` folder?
Implementing new models and features into OpenMMLab's algorithm libraries could be troublesome due to the rigorous requirements on code quality, which could hinder the fast iteration of SOTA models and might discourage our members from sharing their latest outcomes here. And that's why we have this `projects/` folder now, where some experimental features, frameworks and models are placed, only needed to satisfy the minimum requirement on the code quality, and can be used as standalone libraries. Users are welcome to use them if they [use MMOCR from source](https://mmocr.readthedocs.io/en/dev-1.x/get_started/install.html#best-practices).
Q2: Why should there be a checklist for a project?
This checklist is crucial not only for this project's developers but the entire community, since there might be some other contributors joining this project and deciding their starting point from this list. It also helps maintainers accurately estimate time and effort on further code polishing, if needed.
Q3: What kind of PR will be merged?
Reaching the first milestone means that this project suffices the minimum requirement of being merged into `projects/`. That is, the very first PR of a project must have all the terms in the first milestone checked. We do not have any extra requirements on the project's following PRs, so they can be a minor bug fix or update, and do not have to achieve one milestone at once. But keep in mind that this project is only eligible to become a part of the core package upon attaining the last milestone.
Q4: Compared to other models in the core packages, why do the model implementations in projects have different training/testing commands?
Projects are organized independently from the core package, and therefore their modules cannot be directly imported by train.py and test.py. Each model implementation in projects should either use `mim` for training/testing as suggested in the example project or provide a custom train.py/test.py.
Q5: How to debug a project with a debugger?
Debugger makes our lives easier, but using it becomes a bit tricky if we have to train/test a model via `mim`. The way to circumvent that is that we can take advantage of relative path to import these modules. Assuming that we are developing a project X and the core modules are placed under `projects/X/modules`, then simply adding `custom_imports = dict(imports='projects.X.modules')` to the config allows us to debug from usual entrypoints (e.g. `tools/train.py`) from the root directory of the algorithm library. Just don't forget to remove 'projects.X' before project publishment.

View File

@ -0,0 +1,3 @@
projects/ABCNet/README.md
projects/ABCNet/README_V2.md
projects/SPTS/README.md