Commit Graph

209 Commits (a9d65271abfcb3137b3defc9fa03049615fe51da)

Author SHA1 Message Date
Ezra-Yu 0184527bd4
[Enhance] Enhence SE layer to support custom squeeze channels. (#417)
* add enhenced SE

* Update

* rm basechannel

* fix docstring

* Update se_layer.py

fix docstring
2021-08-20 13:31:44 +08:00
Ma Zerun f9eb9b409b
[Docs] Add Copyright information. (#413) 2021-08-17 19:52:42 +08:00
Azad Baykara 5c4da16084
[Docs] Fix typo 'metirc' (#411) 2021-08-17 10:35:26 +08:00
Ma Zerun c0a4916a06
[Enhance] Update `digit_version` function. (#402)
* Update digit_version

* Add digit_version unit test
2021-08-12 12:13:25 +08:00
Ma Zerun f8f1700860
[Refactor] Use post_process function to handle pred result processing. (#390)
Use post_process function to handle pred result processing in `simple_test`.
2021-08-12 11:54:24 +08:00
Vladislav Sovrasov b54acfd5c4
[Enhance] Avoid unnecessary listdir when building ImageNet. (#396) 2021-08-06 10:38:36 +08:00
Ma Zerun ade7b80e44
Bump version to v0.14.0 (#389) 2021-08-04 13:25:42 +08:00
Ma Zerun e8822ebaec
[Docs] Fix some bugs in readthedocs pdf build. (#383)
* Add escape symbols for underscores in formulas.

* Support Chinese characters in pdf output.
2021-07-31 14:49:36 +08:00
whcao 359f56ad58
[Feature] Add transformer in transformer (#339)
* add tnt_small configs

* add tnt backbone

* test tnt

* add tnt to model_zoo

* rename the config file name

* add optimizor

* move tnt backbone unitest

* add metric

* fix keyname in arch

* encapsulate "inner transformer block" and "outer transformer block"

* fix TnT

* Use `inner_block_cfg` and `outer_block_cfg` instead of `args` and
`kwargs`.

Co-authored-by: mzr1996 <mzr1996@163.com>
2021-07-30 09:16:27 +08:00
pvys db856df43e
[Fix] Fix ImageNet dataset annotation file parse bug. (#370)
Co-authored-by: mzr1996 <mzr1996@163.com>
2021-07-29 10:21:22 +08:00
Junjun2016 e3b77e7508
[Fix] Fix `patch_cfg` argument bug in SwinTransformer (#368) 2021-07-27 19:19:44 +08:00
Junjun2016 1585ca83c8
[Fix] Fix docstring typo and init error in ShuffleNetV1 (#374) 2021-07-27 19:17:42 +08:00
Ma Zerun 33a4c0fe9f
[Fix] Use local ATTENTION registery to avoid conflict with other repo. (#375) 2021-07-27 17:59:05 +08:00
Ma Zerun 899047a3b3
Fix duplicate `init_weights` call in ViT init function. (#373) 2021-07-26 05:33:11 -04:00
Ma Zerun 15cd34bbef
[Fix] Use zero as default value of `thrs` in metrics. (#341)
* Use zero as default value of `thrs` in metrics. And it accepcts a number
instead of float now.

* Fix unit test comment

* Don't pass thrs if no thrs.
2021-07-18 16:57:21 +08:00
Ma Zerun 76c5d34dcc
[Feature] Support two options in `build_dataloader`. (#349)
* Support presistent_works in dataloader.

* Use pin_memory by default
2021-07-14 15:21:49 +08:00
Ma Zerun a97ccd5579
[Fix] Fix swin transformer config (#355)
* Fix config bug in swin

* Format config and checkpoint name of swin transformer.

* Fix link in model zoo
2021-07-14 15:10:20 +08:00
Ma Zerun d04ebc1eb5
[Docs] Add API Reference in the docs (#342)
* Add API inference in the docs and fix readthedocs config.

* Replace some relative link in docs.

* Format docstring for reStructuredText syntax.

* Fix vit paper link

* Fix docstring of `show_results` function in `BaseClassifier`.
2021-07-14 15:06:50 +08:00
Ma Zerun 1a7cebe4b9
[Refactor] Refactor unittest (#321)
* Refactor unit tests folder structure.

* Remove label smooth and Vit test in `test_classifiers.py`

* Rename test_utils in dataset to test_dataset_utils

* Split test_models/test_utils/test_utils.py to multiple sub files.

* Add unit tests of classifiers and heads

* Use patch context manager.

* Add unit test of `is_tracing`, and add warning in `is_tracing` if torch
verison is smaller than 1.6.0
2021-07-08 22:49:05 +08:00
Ma Zerun 71621a5f62
Add `is_tracing` helper function to fix a tracing bug in PyTorch 1.6 (#347) 2021-07-07 11:55:53 +08:00
Ma Zerun 2ccc55ce4f
bump version to v0.13.0 (#340) 2021-07-05 10:19:57 +08:00
Ma Zerun 076ee10cac
[Feature] Add swin-transformer model. (#271)
* Add swin transformer archs S, B and L.

* Add SwinTransformer configs

* Add train config files of swin.

* Align init method with original code

* Use nn.Unfold to merge patch

* Change all ConfigDict to dict

* Add init_cfg for all subclasses of BaseModule.

* Use mmcv version init function

* Add Swin README

* Use safer cfg copy method

* Improve docstring and variable name.

* Fix some difference in randaug

Fix BGR bug, align scheduler config.

Fix label smoothing parameter difference.

* Fix missing droppath in attn

* Fix bug of relative posititon table if window width is not equal to
height.

* Make `PatchMerging` more general, support kernel, stride, padding and
dilation.

* Rename `residual` to `identity` in attention and FFN.

* Add `auto_pad` option to auto pad feature map

* Improve docstring.

* Fix bug in ShiftWMSA padding.

* Remove unused `key` and `value` in ShiftWMSA

* Move `PatchMerging` into utils and use common `PatchEmbed`.

* Use latest `LinearClsHead`, train augments and label smooth settings.
And remove original `SwinLinearClsHead`.

* Mark some configs as "Evalution Only".

* Remove useless comment in config

* 1. Move ShiftWindowMSA and WindowMSA to `utils/attention.py`
2. Add docstrings of each module.
3. Fix some variables' names.
4. Other small improvement.

* Add unit tests of swin-transformer and patchmerging.

* Fix some bugs in unit tests.

* Fix bug of rel_position_index if window is not square.

* Make WindowMSA implicit, and add unit tests.

* Add metafile.yml, update readme and model_zoo.
2021-07-01 09:30:42 +08:00
Mingqiang Ning 4ebee155e8
fix a bug when samples_per_gpu==1 (#311) 2021-06-30 20:57:21 +08:00
whcao bee0ac6b56
[Refactor]Modify patchembed (#330)
* add mytrain.py for test

* test before layers

* test attr in layers

* test classifier

* delete mytrain.py

* add patchembed and hybridembed

* add patchembed and hybridembed to __init__

* test patchembed and hybridembed

* fix some comments
2021-06-30 20:48:04 +08:00
Ezra-Yu 06bbd6940d
[Fix] Fix init_weights bug in some backbones and update Readme (#318)
* some init_weights bugs

* init_weights

* add import Basemodule

* code stye

* isort

* Use recommend init_weights override method.

Add init_cfg parameter in InvertedResidual.

Remove some useless comment.

Co-authored-by: mzr1996 <mzr1996@163.com>
2021-06-30 19:41:58 +08:00
Ma Zerun 19cfb25e5e
Use parameter default value to control default behavior of init_cfg in (#319)
`LinearClsHead` and `MultiLabelLinearClsHead`

And remove the verbose `_init_layers` method of `LinearClsHead` and
`MultiLabelLinearClsHead`.
2021-06-30 19:13:27 +08:00
Ma Zerun 65410b05ad
Fix Mobilenetv3 structure and add pretrained model (#291)
* Refactor Mobilenetv3 structure and add ConvClsHead.

* Change model's name from 'MobileNetv3' to 'MobileNetV3'

* Modify configs for MobileNetV3 on CIFAR10.

And add MobileNetV3 configs for imagenet

* Fix activate setting bugs in MobileNetV3.

And remove bias in SELayer.

* Modify unittest

* Remove useless config and file.

* Fix mobilenetv3-large arch setting

* Add dropout option in ConvClsHead

* Fix MobilenetV3 structure according to torchvision version.

1. Remove with_expand_conv option in InvertedResidual, it should be decided by channels.

2. Revert activation function, should before SE layer.

* Format code.

* Rename MobilenetV3 arch "big" to "large".

* Add mobilenetv3_small torchvision training recipe

* Modify default `out_indices` of MobilenetV3, now it will change
according to `arch` if not specified.

* Add MobilenetV3 large config.

* Add mobilenetv3 README

* Modify InvertedResidual unit test.

* Refactor ConvClsHead to StackedLinearClsHead, and add unit tests.

* Add unit test for `simple_test` of `StackedLinearClsHead`.

* Fix typo

Co-authored-by: Yidi Shao <ydshao@smail.nju.edu.cn>
2021-06-27 23:19:36 +08:00
Ma Zerun 53c0df271f
Fix magnitude_std bug in RandAugment, and update unit tests. (#309) 2021-06-21 11:25:11 +08:00
whcao 3a08db9182
[Feature]Add augments to models/utils (#278)
* add mytrain.py for test

* test before layers

* test attr in layers

* test classifier

* delete mytrain.py

* add rand_bbox_minmax rand_bbox and cutmix_bbox_and_lam to BaseCutMixLayer

* add mixup_prob to BatchMixupLayer

* add cutmixup

* add cutmixup to __init__

* test classifier with cutmixup

* delete some comments

* set mixup_prob default to 1.0

* add cutmixup to classifier

* use cutmixup

* use cutmixup

* fix bugs

* test cutmixup

* move mixup and cutmix to augment

* inherit from BaseAugment

* add BaseAugment

* inherit from BaseAugment

* rename identity.py

* add @

* build augment

* register module

* rename to augment.py

* delete cutmixup.py

* do not inherit from BaseAugment

* add augments

* use augments in classifier

* prob default to 1.0

* add comments

* use augments

* use augments

* assert sum of augmentation probabilities should equal to 1

* augmentation probabilities equal to 1

* calculate Identity prob

* replace xxx with self.xxx

* add comments

* sync with augments

* for BC-breaking

* delete useless comments in mixup.py
2021-06-20 09:44:51 +08:00
whcao b9879a4667
[Bug]Fix linearclshead (#307)
* add mytrain.py for test

* test before layers

* test attr in layers

* test classifier

* delete mytrain.py

* fix init_cfg bug
2021-06-16 00:37:16 +08:00
whcao d62f198d2b
[Feature]Support custom hooks (#305)
* add mytrain.py for test

* test before layers

* test attr in layers

* test classifier

* delete mytrain.py

* register custom_hooks in runner

* set custom_hooks_config to cfg.get(custom_hooks, None)
2021-06-15 21:09:58 +08:00
whcao 438c9da6eb
[Feature]Fix linear cls head (#303)
* add mytrain.py for test

* test before layers

* test attr in layers

* test classifier

* delete mytrain.py

* move init_cfg to parameter

* isort

* Use a sentinel value to denote the default init_cfg
2021-06-15 21:08:30 +08:00
AllentDan a24a9f6faa
[Fix] Build compatible with low pytorch versions (#301)
* add version compatible for torchscript

* doc

* doc again

* fix lint

* fix lint isort
2021-06-14 23:25:35 +08:00
WRH b99bd4fa88
Fix bug for CPU training (#286)
* remove MMDataParallel when using cpu

* support cpu testing

* fix lint
2021-06-12 22:26:33 +08:00
AllentDan c2f01e0dcd
[Feature] Add torchscript deployment (#279)
* add torchscript deploy

* fix lint

* add check and delete \
2021-06-12 21:50:48 +08:00
q.yao dbddde52ef
[Feature] TensorRT test tools. (#284)
* first commit

* update resnext result

* update docs

* update docstring
2021-06-12 21:47:10 +08:00
whcao 5e1a02103f
[Feature]Delete comments (#298)
* add mytrain.py for test

* test before layers

* test attr in layers

* test classifier

* delete mytrain.py

* delete comments
2021-06-12 21:45:22 +08:00
Ma Zerun 84a939f858
Refactor LabelSmoothLoss (#285)
* Refector label smooth loss, now support mode `original`, `classy_vision`
and `multi_label`.

* Add unittests for label smooth loss.

* Improve docstring of LSR
2021-06-12 21:32:18 +08:00
LXXXXR 6de635a81c
[Bug] Missing test data when num_imgs can not be evenly divided by num_gpus (#299)
* fix bug in test

* remove unneccesary code
2021-06-11 15:53:23 +08:00
Miao Zheng 4ca21c7d03
[WIP] Refactoring weights initialization (#270)
* [WIP] Refactoring weights initialization

* fix lint and constant init cfg

* fix pretrained bug

* fix typo

* fix isort

* revise model utils
2021-06-10 10:54:34 +08:00
LXXXXR 27a49a9646
bump version to v0.12.0 (#287) 2021-06-03 11:42:34 +08:00
LXXXXR 2c9e12f850
[Feature] Add an argument `efficientnet_style` to `RandomResizedCrop` and `CenterCrop` (#268)
* add config for resnest test

* fix config

* add label smoothing

* add memcached

* minor fix

* fix bug

* fix config

* add config

* minor fix

* fix configs

* use EResize

* change interpolation

* add more configs

* add docsting

* add unittest

* remove unnecessary changes

* minor fix

* add more docstring

* fix linting

* refactor

* add resize in crop to ensure crop size is output size

* fix bug and add comments

* fix bug
2021-05-31 14:10:57 +08:00
LXXXXR b23b319f56
fix version (#276) 2021-05-29 10:47:16 +08:00
LXXXXR bd9411d743
[Bug] Download dataset only on rank 0 (#273)
* only download dataset on rank 0

* download only on rank 0

* fix bug

* fix error message
2021-05-29 10:45:58 +08:00
Yinhao Li b67a11c548
Fix kwargss to kwargs. (#274) 2021-05-26 19:27:30 +08:00
LXXXXR dac090162d
Bump version to v0.11.1 (#256)
* bump version to v0.11.1

* minor fix

* minor fix

* minor fix

* minor fix
2021-05-21 16:36:08 +08:00
Y. Xiong 82e3937174
[Fix] Only allow directory operation when rank==0 when testing (#258)
* only allow dir operation when rank==0

* move check dir to multi_gpu_test
2021-05-21 14:04:46 +08:00
Ma Zerun 09597e5a4c
Add transform `RandomErasing` (#248)
* Add transform `RandomErasing`.

* Add unittests of `RandomErasing`

* Fix typo in docstring

* Improve docstring and unittests.
2021-05-19 22:35:26 +08:00
LXXXXR dc296f64c6
[Fix] Fix multi-node test tmp dir (#251)
* fix multi-node test tmp dir

* fix mmcv version
2021-05-16 21:53:13 +08:00
Wenwei Zhang 5ee08767f2
inherits mmcv registry (#252) 2021-05-14 23:36:56 +08:00