Skip to content

Commit

Permalink
Update for mmdet v2.25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shinya7y committed Jun 18, 2022
1 parent 13d2903 commit a8661f8
Show file tree
Hide file tree
Showing 25 changed files with 150 additions and 93 deletions.
19 changes: 9 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ repos:
rev: v2.1.0
hooks:
- id: codespell
# TODO
# - repo: https://github.com/executablebooks/mdformat
# rev: 0.7.14
# hooks:
# - id: mdformat
# args: ["--number"]
# additional_dependencies:
# - mdformat-gfm
# - mdformat_frontmatter
# - linkify-it-py
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.14
hooks:
- id: mdformat
args: ["--number"]
additional_dependencies:
- mdformat-gfm
- mdformat_frontmatter
- linkify-it-py
- repo: https://github.com/myint/docformatter
rev: v1.3.1
hooks:
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ https://arxiv.org/abs/2103.14027

- recent:
- Add FocalNet, GBR COTS dataset
- Update codes for mmdet 2.22.0, mmcv-full 1.4.4
- Update codes for mmdet 2.25.0, mmcv-full 1.4.4
- 21.12 (Dec. 2021):
- Support [finer scale-wise AP metrics](docs/en/tutorials/finer_scale_ap.md)
- Add codes for TOOD, ConvMLP, PoolFormer
Expand Down Expand Up @@ -136,7 +136,6 @@ When merging, please note that there are some minor differences from the above r

<br><br>


<div align="center">
<img src="resources/mmdet-logo.png" width="600"/>
<div>&nbsp;</div>
Expand Down
Empty file modified configs/cbnet/README.md
100755 → 100644
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,9 @@
train=dict(pipeline=train_pipeline),
val=dict(pipeline=test_pipeline),
test=dict(pipeline=test_pipeline))
optimizer = dict(lr=0.0001 * (samples_per_gpu / 2))
optimizer = dict(lr=0.0001 / 2)

# NOTE: `auto_scale_lr` is for automatically scaling LR,
# USER SHOULD NOT CHANGE ITS VALUES.
# base_batch_size = (8 GPUs) x (1 samples per GPU)
auto_scale_lr = dict(base_batch_size=8)
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,9 @@
train=dict(pipeline=train_pipeline),
val=dict(pipeline=test_pipeline),
test=dict(pipeline=test_pipeline))
optimizer = dict(lr=0.0001 * (samples_per_gpu / 2))
optimizer = dict(lr=0.0001 / 2)

# NOTE: `auto_scale_lr` is for automatically scaling LR,
# USER SHOULD NOT CHANGE ITS VALUES.
# base_batch_size = (8 GPUs) x (1 samples per GPU)
auto_scale_lr = dict(base_batch_size=8)
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
optimizer = dict(
_delete_=True,
type='AdamW',
lr=0.0001 * (samples_per_gpu / 2),
lr=0.0001 / 2,
betas=(0.9, 0.999),
weight_decay=0.05,
paramwise_cfg=dict(
Expand All @@ -96,3 +96,8 @@
}))

fp16 = dict(loss_scale=dict(init_scale=512))

# NOTE: `auto_scale_lr` is for automatically scaling LR,
# USER SHOULD NOT CHANGE ITS VALUES.
# base_batch_size = (8 GPUs) x (1 samples per GPU)
auto_scale_lr = dict(base_batch_size=8)
6 changes: 6 additions & 0 deletions configs/cbnet/model_zoo.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@
| DB-ResNet50 | 1x | 40.8 | 69M | 284G | [config](faster_rcnn_cbv2d1_r50_fpn_1x_coco.py) | [github](https://github.com/CBNetwork/storage/releases/download/v1.0.0/faster_rcnn_cbv2d1_r50_fpn_1x_coco.log.json) | [github](https://github.com/CBNetwork/storage/releases/download/v1.0.0/faster_rcnn_cbv2d1_r50_fpn_1x_coco.pth.zip) |

### Cascade R-CNN (1600x1400)

| Backbone | Lr Schd | box mAP (minival/test-dev) | #params | FLOPs | config | model |
| :---------------: | :------------: | :------------------------: | :-----: | :---: | :-------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------: |
| DB-Res2Net101-DCN | 20e | 53.7/- | 141M | 429G | [config](cascade_rcnn_cbv2d1_r2_101_mdconv_fpn_20e_fp16_ms400-1400_coco.py) | [github](https://github.com/CBNetwork/storage/releases/download/v1.0.0/cascade_rcnn_cbv2d1_r2_101_mdconv_fpn_20e_fp16_ms400-1400_coco.pth.zip) |
| DB-Res2Net101-DCN | 20e + 1x (swa) | 54.8/55.3 | 141M | 429G | [config (test only)](cascade_rcnn_cbv2d1_r2_101_mdconv_fpn_20e_fp16_ms400-1400_coco.py) | [github](https://github.com/CBNetwork/storage/releases/download/v1.0.0/cascade_rcnn_cbv2d1_r2_101_mdconv_fpn_20e_fp16_ms400-1400_coco_swa.pth.zip) |

### Cascade R-CNN w/ 4conv1fc (1600x1400)

| Backbone | Lr Schd | box mAP (minival/test-dev) | #params | FLOPs | config | model |
| :---------------: | :------------: | :------------------------: | :-----: | :---: | :--------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| DB-Res2Net101-DCN | 20e | 54.1/- | 146M | 774G | [config](cascade_rcnn_cbv2d1_r2_101_mdconv_fpn_20e_fp16_ms400-1400_giou_4conv1f_coco.py) | [github](https://github.com/CBNetwork/storage/releases/download/v1.0.0/cascade_rcnn_cbv2d1_r2_101_mdconv_fpn_20e_fp16_ms400-1400_giou_4conv1f_coco.pth.zip) |
| DB-Res2Net101-DCN | 20e + 1x (swa) | 55.3/55.6 | 146M | 774G | [config (test only)](cascade_rcnn_cbv2d1_r2_101_mdconv_fpn_20e_fp16_ms400-1400_giou_4conv1f_coco.py) | [github](https://github.com/CBNetwork/storage/releases/download/v1.0.0/cascade_rcnn_cbv2d1_r2_101_mdconv_fpn_20e_fp16_ms400-1400_giou_4conv1f_coco_swa.pth.zip) |

**Notes**:

- For SWA training, please refer to [SWA Object Detection](https://github.com/hyz-xmaster/swa_object_detection)

## Transformer-based (w/ ImageNet-1k pretrained)
Expand All @@ -32,18 +35,21 @@
| DB-Swin-T | 3x | 50.2 | 44.5 | 76M | 357G | [config](mask_rcnn_cbv2_swin_tiny_patch4_window7_mstrain_480-800_adamw_3x_coco.py) | [github](https://github.com/CBNetwork/storage/releases/download/v1.0.0/mask_rcnn_cbv2_swin_tiny_patch4_window7_mstrain_480-800_adamw_3x_coco.log.json) | [github](https://github.com/CBNetwork/storage/releases/download/v1.0.0/mask_rcnn_cbv2_swin_tiny_patch4_window7_mstrain_480-800_adamw_3x_coco.pth.zip) |

### Cascade Mask R-CNN w/ 4conv1fc

| Backbone | Lr Schd | box mAP (minival) | mask mAP (minival) | #params | FLOPs | config | log | model |
| :-------: | :-----: | :---------------: | :----------------: | :-----: | :---: | :----------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------: |
| DB-Swin-T | 3x | 53.6 | 46.2 | 114M | 836G | [config](cascade_mask_rcnn_cbv2_swin_tiny_patch4_window7_mstrain_480-800_adamw_3x_coco.py) | [github](https://github.com/CBNetwork/storage/releases/download/v1.0.0/cascade_mask_rcnn_cbv2_swin_tiny_patch4_window7_mstrain_480-800_adamw_3x_coco.log.json) | [github](https://github.com/CBNetwork/storage/releases/download/v1.0.0/cascade_mask_rcnn_cbv2_swin_tiny_patch4_window7_mstrain_480-800_adamw_3x_coco.pth.zip) |

### Cascade Mask R-CNN w/ 4conv1fc (1600x1400)

| Backbone | Lr Schd | box mAP (minival/test-dev) | mask mAP (minival/test-dev) | #params | FLOPs | config | model |
| :-------: | :-----: | :------------------------: | :-------------------------: | :-----: | :---: | :------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| DB-Swin-S | 3x | 56.3/56.9 | 48.6/49.1 | 156M | 1016G | [config](cascade_mask_rcnn_cbv2_swin_small_patch4_window7_mstrain_400-1400_adamw_3x_coco.py) | [github](https://github.com/CBNetwork/storage/releases/download/v1.0.0/cascade_mask_rcnn_cbv2_swin_small_patch4_window7_mstrain_400-1400_adamw_3x_coco.pth.zip) |

## Transformer-based (w/ ImageNet-22k pretrained)

### HTC (1600x1400)

| Backbone | Lr Schd | box mAP (minival/test-dev) | mask mAP (minival/test-dev) | #params | FLOPs | config | model |
| :-------: | :------------: | :------------------------: | :-------------------------: | :-----: | :---: | :----------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------: |
| DB-Swin-B | 20e | 57.9/- | 50.2/- | 231M | 1004G | [config](htc_cbv2_swin_base_patch4_window7_mstrain_400-1400_adamw_20e_coco.py) | [github](https://github.com/CBNetwork/storage/releases/download/v1.0.0/htc_cbv2_swin_base22k_patch4_window7_mstrain_400-1400_adamw_20e_coco.pth.zip) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@
custom_hooks = [
dict(type='YOLOXModeSwitchHook', num_last_epochs=0, priority=48)
]

# NOTE: `auto_scale_lr` is for automatically scaling LR,
# USER SHOULD NOT CHANGE ITS VALUES.
# base_batch_size = (4 GPUs) x (2 samples per GPU)
auto_scale_lr = dict(base_batch_size=8)
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@
custom_hooks = [
dict(type='YOLOXModeSwitchHook', num_last_epochs=0, priority=48)
]

# NOTE: `auto_scale_lr` is for automatically scaling LR,
# USER SHOULD NOT CHANGE ITS VALUES.
# base_batch_size = (4 GPUs) x (2 samples per GPU)
auto_scale_lr = dict(base_batch_size=8)
3 changes: 3 additions & 0 deletions configs/focalnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ See the [official repository](https://github.com/microsoft/FocalNet/tree/ecfa580
### Notes

- We may need key conversion for the official Sparse R-CNN weights.
- Although most configs set `samples_per_gpu=1`, the authors overwrite it with `samples_per_gpu=2`.
See [detection/README.md](https://github.com/microsoft/FocalNet/blob/main/detection/README.md) and `"iter": 7330` in [logs](https://github.com/microsoft/FocalNet/tree/ecfa580e252a106899e03de13af543f580f43da2#object-detection-on-coco).
Thus we keep `base_batch_size=16` in `auto_scale_lr`.
- If you find performance difference from apex (used by the original authors), please raise an issue.

## Citation
Expand Down
10 changes: 5 additions & 5 deletions configs/gflv2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ For details see [GFocalV2](https://arxiv.org/abs/2011.12885).
| X-101-dcn | 2x | Yes | 48.8 | 10.7 | [model](https://drive.google.com/file/d/1AHDVQoclYPSP0Ync2a5FCsr_rhq2QdMH/view?usp=sharing) |
| R2-101-dcn | 2x | Yes | 49.9 | 10.9 | [model](https://drive.google.com/file/d/1sAXfYLXIxZgMrC44LBqDgfYImThZ_kud/view?usp=sharing) |

[1] *The reported numbers here are from new experimental trials (in the cleaned repo), which may be slightly different from the original paper.* \
[2] *Note that the 1x performance may be slightly unstable due to insufficient training. In practice, the 2x results are considerably stable between multiple runs.* \
[3] *All results are obtained with a single model and without any test time data augmentation such as multi-scale, flipping and etc..* \
[4] *`dcn` denotes deformable convolutional networks.* \
[5] *FPS is tested with a single GeForce RTX 2080Ti GPU, using a batch size of 1.*
\[1\] *The reported numbers here are from new experimental trials (in the cleaned repo), which may be slightly different from the original paper.* \
\[2\] *Note that the 1x performance may be slightly unstable due to insufficient training. In practice, the 2x results are considerably stable between multiple runs.* \
\[3\] *All results are obtained with a single model and without any test time data augmentation such as multi-scale, flipping and etc..* \
\[4\] *`dcn` denotes deformable convolutional networks.* \
\[5\] *FPS is tested with a single GeForce RTX 2080Ti GPU, using a batch size of 1.*

## Citation

Expand Down
30 changes: 13 additions & 17 deletions configs/manga109/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,43 +16,39 @@ Please see [our manga109api fork](https://github.com/shinya7y/manga109api) to co
We use [68train, 4val, and 15test splits](#dataset-splits).
The 15test set was selected to be well-balanced for reliable evaluation.


## Results

### 68train, 15test (Manga109-s v2020.12.18)

| Method | Backbone | Lr schd | AP | Download |
| :---------------: | :------: | :-----: | :---: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| Faster R-CNN | R-50 | 1x | 65.8 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/faster_rcnn_r50_fpn_fp16_4x4_1x_manga109s_20201219_epoch_12-264d9f31.pth) |
| Cascade R-CNN | R-50 | 1x | 67.6 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/cascade_rcnn_r50_fpn_fp16_4x4_1x_manga109s_20201219_epoch_12-aece91e1.pth) |
| RetinaNet | R-50 | 1x | 65.3 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/retinanet_r50_fpn_fp16_4x4_1x_manga109s_20201219_epoch_12-9fa45ba4.pth) |
| ATSS | R-50 | 1x | 66.5 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/atss_r50_fpn_fp16_4x4_1x_manga109s_20201219_epoch_12-c3e34e96.pth) |
| ATSS | Swin-T | 1x | 66.2 | [model](https://github.com/shinya7y/weights/releases/download/v1.0.1/atss_swint_fpn_fp16_4x4_adamw_1x_manga109s_20210504_epoch_12-c96ddec3.pth) |
| ATSS+SEPC | R-50 | 1x | 67.1 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/atss_r50_fpn_sepc_noibn_fp16_4x4_1x_manga109s_20201219_epoch_12-b9eef036.pth) |
| GFL | R-50 | 1x | 67.3 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/gfl_r50_fpn_fp16_4x4_1x_manga109s_20201219_epoch_12-49659797.pth) |
| UniverseNet | R2-50 | 1x | 68.9 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/universenet50_fp16_4x4_mstrain_480_960_1x_manga109s_20201220_epoch_12-ae4e7451.pth) |
| UniverseNet 20.08 | R2-50 | 1x | 69.9 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/universenet50_2008_fp16_4x4_mstrain_480_960_1x_manga109s_20201220_epoch_12-6af914a4.pth) |
| Method | Backbone | Lr schd | AP | Download |
| :---------------: | :------: | :-----: | :--: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------: |
| Faster R-CNN | R-50 | 1x | 65.8 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/faster_rcnn_r50_fpn_fp16_4x4_1x_manga109s_20201219_epoch_12-264d9f31.pth) |
| Cascade R-CNN | R-50 | 1x | 67.6 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/cascade_rcnn_r50_fpn_fp16_4x4_1x_manga109s_20201219_epoch_12-aece91e1.pth) |
| RetinaNet | R-50 | 1x | 65.3 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/retinanet_r50_fpn_fp16_4x4_1x_manga109s_20201219_epoch_12-9fa45ba4.pth) |
| ATSS | R-50 | 1x | 66.5 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/atss_r50_fpn_fp16_4x4_1x_manga109s_20201219_epoch_12-c3e34e96.pth) |
| ATSS | Swin-T | 1x | 66.2 | [model](https://github.com/shinya7y/weights/releases/download/v1.0.1/atss_swint_fpn_fp16_4x4_adamw_1x_manga109s_20210504_epoch_12-c96ddec3.pth) |
| ATSS+SEPC | R-50 | 1x | 67.1 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/atss_r50_fpn_sepc_noibn_fp16_4x4_1x_manga109s_20201219_epoch_12-b9eef036.pth) |
| GFL | R-50 | 1x | 67.3 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/gfl_r50_fpn_fp16_4x4_1x_manga109s_20201219_epoch_12-49659797.pth) |
| UniverseNet | R2-50 | 1x | 68.9 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/universenet50_fp16_4x4_mstrain_480_960_1x_manga109s_20201220_epoch_12-ae4e7451.pth) |
| UniverseNet 20.08 | R2-50 | 1x | 69.9 | [model](https://github.com/shinya7y/UniverseNet/releases/download/20.12/universenet50_2008_fp16_4x4_mstrain_480_960_1x_manga109s_20201220_epoch_12-6af914a4.pth) |

- In addition to ATSS+SEPC, UniverseNet uses Res2Net-v1b-50, DCN, and multi-scale training (480-960).
- The settings for normalization layers (including whether to use iBN of SEPC) depend on the config files.
- All models were trained and evaluated using fp16 (mixed precision).
- Each model was fine-tuned from a corresponding COCO pre-trained model.


## Dataset splits

- 15test: ["Akuhamu", "BakuretsuKungFuGirl", "DollGun", "EvaLady", "HinagikuKenzan", "KyokugenCyclone", "LoveHina_vol01", "MomoyamaHaikagura", "TennenSenshiG", "UchiNoNyan'sDiary", "UnbalanceTokyo", "YamatoNoHane", "YoumaKourin", "YumeNoKayoiji", "YumeiroCooking"]
- 4val: ["HealingPlanet", "LoveHina_vol14", "SeisinkiVulnus", "That'sIzumiko"]
- 15test: `["Akuhamu", "BakuretsuKungFuGirl", "DollGun", "EvaLady", "HinagikuKenzan", "KyokugenCyclone", "LoveHina_vol01", "MomoyamaHaikagura", "TennenSenshiG", "UchiNoNyan'sDiary", "UnbalanceTokyo", "YamatoNoHane", "YoumaKourin", "YumeNoKayoiji", "YumeiroCooking"]`
- 4val: `["HealingPlanet", "LoveHina_vol14", "SeisinkiVulnus", "That'sIzumiko"]`
- 68train: All the other volumes


## Notes

- Please check the dataset licenses ([Manga109](http://www.manga109.org/en/download.html), [Manga109-s](http://www.manga109.org/en/download_s.html)).
- The typical scale of the original images is (1654, 1170).
The number of maximum total pixels of (1216, 864) for Manga109 is almost the same as that of (1333, 800) for COCO.


## Citations

Users must cite the two papers below for use in academic papers.
Expand Down
Loading

0 comments on commit a8661f8

Please sign in to comment.