Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] Refactor doc structures. #8660

Merged
merged 9 commits into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
679 changes: 0 additions & 679 deletions docs/en/1_exist_data_model.md

This file was deleted.

281 changes: 0 additions & 281 deletions docs/en/2_new_data_model.md

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Tutorial 2: Customize Datasets
# Customize Datasets

## Support new data format

Expand Down Expand Up @@ -183,7 +183,7 @@ We use this way to support CityScapes dataset. The script is in [cityscapes.py](
### Reorganize new data format to middle format

It is also fine if you do not want to convert the annotation format to COCO or PASCAL format.
Actually, we define a simple annotation format in MMEninge's [BaseDataset ](https://github.com/open-mmlab/mmengine/blob/main/mmengine/dataset/base_dataset.py#L116) and all existing datasets are
Actually, we define a simple annotation format in MMEninge's [BaseDataset](https://github.com/open-mmlab/mmengine/blob/main/mmengine/dataset/base_dataset.py#L116) and all existing datasets are
processed to be compatible with it, either online or offline.

The annotation of the dataset must be in `json` or `yaml`, `yml` or `pickle`, `pkl` format; the dictionary stored in the annotation file must contain two fields `metainfo` and `data_list`. The `metainfo` is a dictionary, which contains the metadata of the dataset, such as class information; `data_list` is a list, each element in the list is a dictionary, the dictionary defines the raw data of one image, and each raw data contains a or several training/testing samples.
Expand Down Expand Up @@ -237,7 +237,7 @@ Here is an example.

Some datasets may provide annotations like crowd/difficult/ignored bboxes, we use `ignore_flag`to cover them.

After obtaining the above standard data annotation format, you can directly use [BaseDetDataset](<>) of MMDetection in the configuration , without conversion.
After obtaining the above standard data annotation format, you can directly use [BaseDetDataset](mmdet.datasets.BaseDetDataset) of MMDetection in the configuration , without conversion.

### An example of customized dataset

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Tutorial 6: Customize Losses
# Customize Losses

MMDetection provides users with different loss functions. But the default configuration may be not applicable for different datasets or models, so users may want to modify a specific loss to adapt the new situation.

Expand Down Expand Up @@ -40,7 +40,7 @@ For some other losses which have positive and negative sample balance mechanism
## Tweaking loss

Tweaking a loss is more related with step 2, 4, 5, and most modifications can be specified in the config.
Here we take [Focal Loss (FL)](https://github.com/open-mmlab/mmdetection/blob/master/mmdet/models/losses/focal_loss.py) as an example.
Here we take [Focal Loss (FL)](https://github.com/open-mmlab/mmdetection/blob/dev-3.x/mmdet/models/losses/focal_loss.py) as an example.
The following code sniper are the construction method and config of FL respectively, they are actually one to one correspondence.

```python
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Tutorial 4: Customize Models
# Customize Models

We basically categorize model components into 5 types.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Tutorial 5: Customize Runtime Settings
# Customize Runtime Settings

## Customize optimization settings

Expand Down Expand Up @@ -140,7 +140,7 @@ Tricks not implemented by the optimizer should be implemented through optimizer
_delete_=True, clip_grad=dict(max_norm=35, norm_type=2))
```

If your config inherits the base config which already sets the `optim_wrapper`, you might need `_delete_=True` to override the unnecessary settings. See the [config documentation](https://mmdetection.readthedocs.io/en/latest/tutorials/config.html) for more details.
If your config inherits the base config which already sets the `optim_wrapper`, you might need `_delete_=True` to override the unnecessary settings. See the [config documentation](../user_guides/config.md) for more details.

- __Use momentum schedule to accelerate model convergence__:
We support momentum scheduler to modify model's momentum according to learning rate, which could make the model converge in a faster way.
Expand Down Expand Up @@ -253,7 +253,7 @@ train_cfg = dict(

#### 1. Implement a new hook

MMEngine provides many useful [hooks](https://mmdetection.readthedocs.io/en/latest/tutorials/hooks.html), but there are some occasions when the users might need to implement a new hook. MMDetection supports customized hooks in training in v3.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.
MMEngine provides many useful [hooks](https://mmengine.readthedocs.io/en/latest/tutorials/hooks.html), but there are some occasions when the users might need to implement a new hook. MMDetection supports customized hooks in training in v3.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.
Here we give an example of creating a new hook in mmdet and using it in training.

```python
Expand Down
Loading