From e81bb136960547190fccdf6b0ad2d97f8f3e25a7 Mon Sep 17 00:00:00 2001 From: Tong Gao Date: Tue, 27 Dec 2022 09:29:22 +0800 Subject: [PATCH] [Projects] Refine example projects and readme (#1628) * update projects * powerhsell --- projects/README.md | 9 ++++++ projects/example_project/README.md | 30 +++++++++++++++++-- ...dbnet_dummy-resnet_fpnc_1200e_icdar2015.py | 6 ++-- 3 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 projects/README.md diff --git a/projects/README.md b/projects/README.md new file mode 100644 index 000000000..368dfb1d7 --- /dev/null +++ b/projects/README.md @@ -0,0 +1,9 @@ +# 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. + +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). + +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. + +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. diff --git a/projects/example_project/README.md b/projects/example_project/README.md index 6d1c1be2e..29fc58b22 100644 --- a/projects/example_project/README.md +++ b/projects/example_project/README.md @@ -16,12 +16,34 @@ This project implements a dummy ResNet wrapper, which literally does nothing new +### Prerequisites + +- Python 3.7 +- PyTorch 1.6 or higher +- [MIM](https://github.com/open-mmlab/mim) +- [MMOCR](https://github.com/open-mmlab/mmocr) + +All the commands below rely on the correct configuration of `PYTHONPATH`, which should point to the project's directory so that Python can locate the module files. In `example_project/` root directory, run the following line to add the current directory to `PYTHONPATH`: + +```shell +# Linux +export PYTHONPATH=`pwd`:$PYTHONPATH +# Windows PowerShell +$env:PYTHONPATH=Get-Location +``` + ### Training commands In MMOCR's root directory, run the following command to train the model: ```bash -python tools/train.py projects/example_project/configs/dbnet_dummy-resnet_fpnc_1200e_icdar2015.py +mim train mmocr configs/dbnet_dummy-resnet_fpnc_1200e_icdar2015.py --work-dir work_dirs/dummy_mae/ +``` + +To train on multiple GPUs, e.g. 8 GPUs, run the following command: + +```bash +mim train mmocr configs/dbnet_dummy-resnet_fpnc_1200e_icdar2015.py --work-dir work_dirs/dummy_mae/ --launcher pytorch --gpus 8 ``` ### Testing commands @@ -29,7 +51,7 @@ python tools/train.py projects/example_project/configs/dbnet_dummy-resnet_fpnc_1 In MMOCR's root directory, run the following command to test the model: ```bash -python tools/test.py projects/example_project/confsigs/dbnet_dummy-resnet_fpnc_1200e_icdar2015.py ${CHECKPOINT_PATH} +mim test mmocr configs/dbnet_dummy-resnet_fpnc_1200e_icdar2015.py --work-dir work_dirs/dummy_mae/ --checkpoint ${CHECKPOINT_PATH} ``` ## Results @@ -60,7 +82,9 @@ year = {2020} ## Checklist -