"...git@developer.sourcefind.cn:OpenDAS/torch-harmonics.git" did not exist on "7a685349651ebf680a85df2fb701eee36b5effde"
Unverified Commit 43f5f427 authored by Ziyi Wu's avatar Ziyi Wu Committed by GitHub
Browse files

[Fix] Typos in .gitignore & error in customize_runtime docs (#497)

* typos in gitignore

* modify customize_runtime docs

* update MMGen description

* replace mmdet with mmdet3d

* add MMOCR
parent 7f3f38d5
...@@ -123,8 +123,8 @@ exps/ ...@@ -123,8 +123,8 @@ exps/
# demo # demo
*.jpg *.jpg
*.png *.png
/data/s3dis/Stanford3dDataset_v1.2_Aligned_Version/ data/s3dis/Stanford3dDataset_v1.2_Aligned_Version/
/data/scannet/scans/ data/scannet/scans/
/data/sunrgbd/OFFICIAL_SUNRGBD/ data/sunrgbd/OFFICIAL_SUNRGBD/
*.obj *.obj
*.ply *.ply
...@@ -148,4 +148,5 @@ We wish that the toolbox and benchmark could serve the growing research communit ...@@ -148,4 +148,5 @@ We wish that the toolbox and benchmark could serve the growing research communit
- [MMTracking](https://github.com/open-mmlab/mmtracking): OpenMMLab video perception toolbox and benchmark. - [MMTracking](https://github.com/open-mmlab/mmtracking): OpenMMLab video perception toolbox and benchmark.
- [MMPose](https://github.com/open-mmlab/mmpose): OpenMMLab pose estimation toolbox and benchmark. - [MMPose](https://github.com/open-mmlab/mmpose): OpenMMLab pose estimation toolbox and benchmark.
- [MMEditing](https://github.com/open-mmlab/mmediting): OpenMMLab image and video editing toolbox. - [MMEditing](https://github.com/open-mmlab/mmediting): OpenMMLab image and video editing toolbox.
- [MMGeneration](https://github.com/open-mmlab/mmgeneration): A powerful toolkit for generative models. - [MMOCR](https://github.com/open-mmlab/mmocr): OpenMMLab text detection, recognition and understanding toolbox.
- [MMGeneration](https://github.com/open-mmlab/mmgeneration): OpenMMLab image and video generative models toolbox.
...@@ -146,7 +146,8 @@ MMDetection3D 是一款由来自不同高校和企业的研发人员共同参与 ...@@ -146,7 +146,8 @@ MMDetection3D 是一款由来自不同高校和企业的研发人员共同参与
- [MMTracking](https://github.com/open-mmlab/mmtracking): OpenMMLab 一体化视频目标感知平台 - [MMTracking](https://github.com/open-mmlab/mmtracking): OpenMMLab 一体化视频目标感知平台
- [MMPose](https://github.com/open-mmlab/mmpose): OpenMMLab 姿态估计工具箱 - [MMPose](https://github.com/open-mmlab/mmpose): OpenMMLab 姿态估计工具箱
- [MMEditing](https://github.com/open-mmlab/mmediting): OpenMMLab 图像视频编辑工具箱 - [MMEditing](https://github.com/open-mmlab/mmediting): OpenMMLab 图像视频编辑工具箱
- [MMGeneration](https://github.com/open-mmlab/mmgeneration): OpenMMLab 生成模型工具箱 - [MMOCR](https://github.com/open-mmlab/mmocr): OpenMMLab 全流程文字检测识别理解工具包
- [MMGeneration](https://github.com/open-mmlab/mmgeneration): OpenMMLab 图片视频生成模型工具箱
## 欢迎加入 OpenMMLab 社区 ## 欢迎加入 OpenMMLab 社区
......
...@@ -20,11 +20,11 @@ To modify the learning rate of the model, the users only need to modify the `lr` ...@@ -20,11 +20,11 @@ To modify the learning rate of the model, the users only need to modify the `lr`
A customized optimizer could be defined as following. A customized optimizer could be defined as following.
Assume you want to add a optimizer named `MyOptimizer`, which has arguments `a`, `b`, and `c`. Assume you want to add a optimizer named `MyOptimizer`, which has arguments `a`, `b`, and `c`.
You need to create a new directory named `mmdet/core/optimizer`. You need to create a new directory named `mmdet3d/core/optimizer`.
And then implement the new optimizer in a file, e.g., in `mmdet/core/optimizer/my_optimizer.py`: And then implement the new optimizer in a file, e.g., in `mmdet3d/core/optimizer/my_optimizer.py`:
```python ```python
from .registry import OPTIMIZERS from mmcv.runner.optimizer import OPTIMIZERS
from torch.optim import Optimizer from torch.optim import Optimizer
...@@ -39,24 +39,33 @@ class MyOptimizer(Optimizer): ...@@ -39,24 +39,33 @@ class MyOptimizer(Optimizer):
To find the above module defined above, this module should be imported into the main namespace at first. There are two options to achieve it. To find the above module defined above, this module should be imported into the main namespace at first. There are two options to achieve it.
- Modify `mmdet/core/optimizer/__init__.py` to import it. - Add `mmdet3d/core/optimizer/__init__.py` to import it.
The newly defined module should be imported in `mmdet/core/optimizer/__init__.py` so that the registry will The newly defined module should be imported in `mmdet3d/core/optimizer/__init__.py` so that the registry will
find the new module and add it: find the new module and add it:
```python ```python
from .my_optimizer import MyOptimizer from .my_optimizer import MyOptimizer
__all__ = ['MyOptimizer']
```
You also need to import `optimizer` in `mmdet3d/core/__init__.py` by adding:
```python
from .optimizer import * # noqa: F401, F403
``` ```
- Use `custom_imports` in the config to manually import it - Use `custom_imports` in the config to manually import it
```python ```python
custom_imports = dict(imports=['mmdet.core.optimizer.my_optimizer'], allow_failed_imports=False) custom_imports = dict(imports=['mmdet3d.core.optimizer.my_optimizer'], allow_failed_imports=False)
``` ```
The module `mmdet.core.optimizer.my_optimizer` will be imported at the beginning of the program and the class `MyOptimizer` is then automatically registered. The module `mmdet3d.core.optimizer.my_optimizer` will be imported at the beginning of the program and the class `MyOptimizer` is then automatically registered.
Note that only the package containing the class `MyOptimizer` should be imported. Note that only the package containing the class `MyOptimizer` should be imported.
`mmdet.core.optimizer.my_optimizer.MyOptimizer` **cannot** be imported directly. `mmdet3d.core.optimizer.my_optimizer.MyOptimizer` **cannot** be imported directly.
Actually users can use a totally different file directory structure using this importing method, as long as the module root can be located in `PYTHONPATH`. Actually users can use a totally different file directory structure using this importing method, as long as the module root can be located in `PYTHONPATH`.
...@@ -190,7 +199,7 @@ so that 1 epoch for training and 1 epoch for validation will be run iteratively. ...@@ -190,7 +199,7 @@ so that 1 epoch for training and 1 epoch for validation will be run iteratively.
There are some occasions when the users might need to implement a new hook. MMDetection supports customized hooks in training (#3395) since v2.3.0. Thus the users could implement a hook directly in mmdet or their mmdet-based codebases and use the hook by only modifying the config in training. There are some occasions when the users might need to implement a new hook. MMDetection supports customized hooks in training (#3395) since v2.3.0. Thus the users could implement a hook directly in mmdet or their mmdet-based codebases and use the hook by only modifying the config in training.
Before v2.3.0, the users need to modify the code to get the hook registered before training starts. Before v2.3.0, the users need to modify the code to get the hook registered before training starts.
Here we give an example of creating a new hook in mmdet and using it in training. Here we give an example of creating a new hook in mmdet3d and using it in training.
```python ```python
from mmcv.runner import HOOKS, Hook from mmcv.runner import HOOKS, Hook
...@@ -225,21 +234,24 @@ Depending on the functionality of the hook, the users need to specify what the h ...@@ -225,21 +234,24 @@ Depending on the functionality of the hook, the users need to specify what the h
#### 2. Register the new hook #### 2. Register the new hook
Then we need to make `MyHook` imported. Assuming the file is in `mmdet/core/utils/my_hook.py` there are two ways to do that: Then we need to make `MyHook` imported. Assuming the file is in `mmdet3d/core/utils/my_hook.py` there are two ways to do that:
- Modify `mmdet/core/utils/__init__.py` to import it. - Modify `mmdet3d/core/utils/__init__.py` to import it.
The newly defined module should be imported in `mmdet/core/utils/__init__.py` so that the registry will The newly defined module should be imported in `mmdet3d/core/utils/__init__.py` so that the registry will
find the new module and add it: find the new module and add it:
```python ```python
from .my_hook import MyHook from .my_hook import MyHook
__all__ = [..., 'MyHook']
``` ```
- Use `custom_imports` in the config to manually import it - Use `custom_imports` in the config to manually import it
```python ```python
custom_imports = dict(imports=['mmdet.core.utils.my_hook'], allow_failed_imports=False) custom_imports = dict(imports=['mmdet3d.core.utils.my_hook'], allow_failed_imports=False)
``` ```
#### 3. Modify the config #### 3. Modify the config
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment