Commit Graph

275 Commits (d56170a73403431b042dcee537fa479e5d0bda5f)

Author SHA1 Message Date
Zhicheng Chen d56170a734
[Feature] Support EfficientNet (#649)
* 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

* add efficient backbone

* add config

* add Edge Residual

* fix bug

* remove unnecessary files

* refactor

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

* fix bug and add comments

* test

* fix

* add more configs

* add more configs

* add more configs

* fix bug

* add model zoo

* fix

* reorganize code

* add edge tpu

* add edge tpu converter

* rename

* update readme

* reorganize code and config

* Rename configs of EfficientNet, and add metafile & model_zoo

* Remove `backend='pillow'`

* Add comments about EfficientNet-EdgeTPU

* Rename the convert tool of EfficientNet.

* Refactor EfficientNet and update docstring.

* Update EfficientNet-EdgeTPU config

* Fix unit tests

Co-authored-by: lixinran <lixr423@outlook.com>
Co-authored-by: lixinran <lixinran@sensetime.com>
Co-authored-by: mzr1996 <mzr1996@163.com>
2022-01-25 12:14:17 +08:00
Yosuke Shinya 16864c7495
[Feature] Support features_only in TIMMBackbone (#668)
* Support features_only in TIMMBackbone

based on https://github.com/open-mmlab/mmsegmentation/pull/998

* update test for mmdet

* fix unit test for build_without_timm

* Update docstring

Co-authored-by: mzr1996 <mzr1996@163.com>
2022-01-25 11:22:23 +08:00
Yusuke Minami e694269c59
[Enhance] Support single-label, softmax, custom eps by asymmetric loss (#609)
Co-authored-by: Minyus <Minyus@users.noreply.github.com>
2022-01-21 11:35:14 +08:00
takuoko d29037e8d1
[Enhance] Suport Mixup&Cutmix for multi-label task. 2022-01-21 11:30:58 +08:00
Ma Zerun b39885d953
[Feature] Support K-fold cross-validation (#563)
* Support to use `indices` to specify which samples to evaluate.

* Add KFoldDataset wrapper

* Rename 'K' to 'num_splits' accroding to sklearn

* Add `kfold-cross-valid.py`

* Add unit tests

* Add help doc and docstring
2022-01-19 18:32:55 +08:00
Ma Zerun 7dfc9e4a85
Bump version to v0.19.0 (#623) 2021-12-31 12:55:47 +08:00
Zhicheng Chen 0bbbb04429
[Enhancement] Improve the accuracy of ResNet (#572)
* add itp timm

* minor update

* minor update

* minor update

* add rep aug, minor update on configs

* minor update

* add target threshold

* add decaymulti

* minor update

* minor update

* add lbl smooth

* update lr

* reorganize config files and code

* minor bugfixes

* remove unused parts and minor fixes on cfg

* critical bugfix, add test and cfg update

* refactor code

* update doc string

* remove duplicate code

* refactor drop path in resnet

* rename

* Modify configs and add README&metafile

* Update metafile

Co-authored-by: mzr1996 <mzr1996@163.com>
2021-12-29 10:58:42 +08:00
Ma Zerun 159b38d276
[Reproduction] Reproduce training results of T2T-ViT (#610)
* Add cosine cool down lr updater

* Use ema hook

* Update decay mult

* Update configs.

* Update T2T-ViT readme and format all readme

* Update swin readme

* Update tnt readme

* Add docstring for `CosineAnnealingCooldownLrUpdaterHook`.

* Update t2t readme and metafile
2021-12-28 15:09:40 +08:00
Ezra-Yu d1d9ebfc67
[Feature] Add Precise BN (#401)
* add preciseBN hook

* add precise-bn config

* add proority of preciseBN

* Add precise BN hook

* Update PreciseBN hook

* add config example & pre-commit

* Update PBN

* Add unit test

* Update unit tests

* mv preciseBN to mmcls.runner

* rm extra sleep()

* merge latest

* update code

* fix lint

* update unit tests

* update unit tests and add warning

* update docstring and renamme filename

* remove model warpper

* add copyright

* Imporve docs and update some variable names

* Update resnet50_8xb32-coslr-preciseBN_in1k.py

Co-authored-by: mzr1996 <mzr1996@163.com>
2021-12-24 16:28:42 +08:00
Ezra-Yu 131d8c6296
[Feature] Add CAM visualization tool (#577)
* add cam-grad tool

* refactor cam-grad tool

* add docs

* update docs

* Update docs and support Transformer

* remove pictures and use link

* replace example img and finish EN docs

* improve docs

* improve code

* Fix MobileNet V3 configs

* Refactor to support more powerful feature extraction.

* Add unit tests

* Fix unit test

* fix distortion of visualization exapmles in docs

* fix distortion

* fix distortion

* fix distortion

* merge master

* merge fix conficts

* Imporve the tool

* Support use both attribute name and index to get layer

* add default get_target-layers

* add default get_target-layers

* update docs

* update docs

* add additional printt info when not using target-layers

* Imporve docs

* Fix enumerate list.

Co-authored-by: mzr1996 <mzr1996@163.com>
2021-12-23 18:53:40 +08:00
Zhicheng Chen da39ca6898
[Fix] Fix test sampler bug. (#611)
* sampler bugfixes

* sampler bugfixes

* reorganize code

* minor fixes

* reorganize code

* minor fixes

* Use `mmcv.runner.get_dist_info` instead of `dist` package to get rank
and world size.

* Add `build_dataloader` unit tests and fix sampler's unit tests.

* Fix unit tests

* Fix unit tests

Co-authored-by: mzr1996 <mzr1996@163.com>
2021-12-23 18:07:41 +08:00
Zhicheng Chen d5ae255061
[Feature] Repeated Aug and Sampler Registry (#588) 2021-12-21 15:26:28 +08:00
Ma Zerun 643fb192cd
[Enhance] Enhance feature extraction function. (#593)
* Fix MobileNet V3 configs

* Refactor to support more powerful feature extraction.

* Add unit tests

* Fix unit test

* Imporve according to comments

* Update checkpoints path

* Fix unit tests

* Add docstring of `simple_test`

* Add docstring of `extract_feat`

* Update model zoo
2021-12-17 15:55:02 +08:00
Ma Zerun f9a2b04cee
[Feature] Add DeiT backbone and checkpoints. (#576)
* Support DeiT backbone.

* Use hook to automatically resize pos embed

* Update ViT training setting

* Add deit configs and update docs

* Fix vit arch assertion

* Remove useless init function

* Add unit tests.

* Fix resize_pos_embed for DeiT

* Improve according to comments.
2021-12-15 22:44:57 +08:00
Ma Zerun 894a82ea4f
[Refactor] Change `load_json_logs` to `load_json_log`. (#602) 2021-12-14 18:03:27 +08:00
mzr1996 5078869b4b [Fix] Fix cal_acc bug caused by the return type of accuracy. 2021-12-14 16:21:25 +08:00
Ma Zerun e3cf1881bb
[Enhance] Imporve efficiency of precision, recall, f1_score and support. (#595)
* [Enhance] Imporve efficiency of precision, recall, f1_score and support.

* Fix bugs

* Use np.maximum since torch doesn't have maximum before torch 1.7

* Fix bug
2021-12-13 17:24:59 +08:00
Zhicheng Chen 851b438574
[Feature] Support LAMB optimizer. (#591)
* impl lamb

* Add unit tests

* Fix unit test

* Fix unit tests

* Use list instead of tuple in `__all__` according to PEP8

Co-authored-by: mzr1996 <mzr1996@163.com>
2021-12-13 17:24:44 +08:00
Ma Zerun 188aa6ed5d
[Enhance] Improve accuracy calculation performance. (#592)
* Imporve accuracy calculate performance.

* Add unit tests for accuracy

* Reuse state_inds
2021-12-09 14:06:08 +08:00
Eduardo López d232912391
[Enhance] Added NumClassCheckHook and unit tests (#559)
* Added NumClassCheckHook and CI tests

* Added HOOKS local registry. NumClassCheckHook and unit test files redistribution.

* Extended hook for supporting IterRunner & EpochRunner. Extended unit test.

* Simplification of ClassNumCheckHook. Minor changes.
2021-12-08 18:15:05 +08:00
Zhiliang Peng 18f6bb0b10
[Feature] Implement the conformer backbone. (#494)
* implement the conformer

* format code style

* format code style

* reuse the TransformerEncoderLayer in the vision_transformer.py

* Modify variable name

* delete unused params

* Remove warning info in Conformer head since it already exists in
Conformer.

* Rename some variables

* Add unit tests

* Use `getattr` instead of `get_submodule`.

* Remove some useless layers

* Refactor conformer and add configs

* Update configs and add metafile.

* Fix unit tests

* Update README

Co-authored-by: mzr1996 <mzr1996@163.com>
2021-12-07 14:00:17 +08:00
fangxu 0aa789f3c3
[Feature] Add the frozen function for Swin Transformer model. (#574)
* Add the frozen function for Swin Transformer model

* add frozen parameter for swin transformer model

* add norm_eval parameter

* Delete =11.1

* Delete =418,driver

* delete _BatchNorm

* remove LayerNorm , add _BatchNorm

* unifying the style of frozen function refer ResNet

* Improve docs and add unit tests.

Co-authored-by: cxiang26 <cq.xiang@foxmail.com>
Co-authored-by: mzr1996 <mzr1996@163.com>
2021-12-07 11:58:14 +08:00
Ma Zerun f2c1c57398
[Docs] Fix docs build dependency. (#584)
* Fix docs.

* Add MMHuman3D
2021-12-07 11:16:33 +08:00
fangxu c090d3f7fd
[Fix] Fix a bug for multiple output in swin transformer. (#571)
* Update swin_transformer.py

fix bug;

layer_norm 0,1,2,3  will be the same and resulted in an error when out_indices dict exceed one element.

* fix bug, layer_norm 0,1,2,3

* Add unit tests for multiple out_indices

Co-authored-by: cxiang26 <cq.xiang@foxmail.com>
Co-authored-by: mzr1996 <mzr1996@163.com>
2021-12-03 16:11:41 +08:00
Ma Zerun d25a78d547
[Enchance] Set a random seed when the user does not set a seed. (#554) 2021-12-02 18:09:55 +08:00
Ma Zerun 78d6d8503f
[Refactor] Use new API of matplotlib to handle blocking input in visualization. (#568)
* [Refactor] Use new API of matplotlib to handle blocking input in
visualization.

* Modify unit tests
2021-12-02 17:46:40 +08:00
takuoko 9d9dce69ad
[Feature] Support using checkpoint in Swin Transformer to save memory. (#557)
* add checkpoint in swin backbone

* add checkpoint in swin backbone
2021-12-01 11:49:00 +08:00
Ma Zerun f6076bfeca
Bump version to v0.18.0 (#569)
* Bump version to v0.18.0

* Add highlight of previous version in readme

* Imporve docs
2021-11-30 19:04:38 +08:00
juanjompz 715a80b09c
[Enhance] Focal loss for single label tasks (#548)
* Added focal loss support to single label tasks.

* Updated focal loss docstring
2021-11-26 12:36:49 +08:00
Ezra-Yu 4b2128fdbd
[Fix] Fix bug when using `ClassBalancedDataset` (#555)
* fix dataset wrapper bug and add unit tests

* fix dataset wrapper bug and add unit tests

* update unit tests

* fix lint

* align interface to mmdet

* update unit tests
2021-11-26 09:40:00 +08:00
Zhicheng Chen fc8adbc149
[Enhance] Add metafile, readme and converted models for MLP-Mixer (#539)
* add pth converter

* minor update on config files, add metafile and readme

* add missing readme and minor fixes

* minor fixes

* Update config names and checkpoint download link

* Update model_zoo.md

Co-authored-by: mzr1996 <mzr1996@163.com>
2021-11-24 19:04:19 +08:00
Ezra-Yu f361bd52e9
[Fix] Fix a bug when using iter-based runner with 'val' workflow (#542)
* add kwargs and default of optimizer in train_step and val_step

* update docstring

* update docstring

* update optional annotation
2021-11-22 12:06:47 +08:00
LeoXing1996 49cbfd776a
[Fix] Fix interpolation method checking in `Resize` (#547)
* fix interpolation method checking in resize

* revise docstring + add unit test
2021-11-19 17:38:25 +08:00
takuoko 9f31fc5390
[Refactor] Use `reset_classifier` to remove head of timm backbones. (#534)
* refactor timm backbone

* fix comment
2021-11-16 16:24:55 +08:00
xcnick 3eafc5cbe1
[Feature] Add MLP Mixer Backbone. (#528)
* Add Mlp Mixer

* Fix token_mix FNN add_identity and add out_indices

* Fix mlp_mixer unit test
2021-11-15 18:25:22 +08:00
Ma Zerun e0d32df076
[Fix] Fix a bug when load checkpoints in mulit-GPUs environment. (#527)
* Fix a bug when load checkpoints in mulit-GPUs environment.

* Map the weights to CPU
2021-11-10 17:54:43 +08:00
Ezra-Yu 87c67a6a79
[Feature] Support positive weights in BCE. (#516)
* add pos-weight in BCE

* mv pos-weight to kwargs
2021-11-10 17:14:12 +08:00
Ezra-Yu 34d5a25281
[Refactor] Support passing arguments to loss from head. (#523) 2021-11-10 17:12:34 +08:00
Zhicheng Chen 9ab9d4ff31
[Refactor] Refactor `Resize` transform and add `Pad` transform. (#506)
* refactor resize, test tobe done

* resize reimpl according to discussion; add pad

* minor fixes and add tests

* minor fixes on docstring

* add additional unit test

* reformat resize and pad

* revise code and docstr according to the comments
2021-11-10 16:46:49 +08:00
Ezra-Yu b486bb23f8
[Feature] Add a tool to visualize learning rate in each iterations (#498)
* add vis lr

* add doc

* Update doc and rm load_json_log in analysis

* Update docs

* add unit tests and update docstring

* fix unit-tests

* Use DummyIterBasedRunner and DummyEpochBasedRunner to simulate training
process.

* rm function val and add judge

* update docs

* improve english expression

* Update docs/tools/visualization.md

Co-authored-by: Ma Zerun <mzr1996@163.com>

* fix typo and ImageNet datasize

* fix typo

* update example

Co-authored-by: mzr1996 <mzr1996@163.com>
2021-11-03 10:48:56 +08:00
Ma Zerun d1473e4a7f
[Dependency] Update mmcv dependency version (#509)
* Update mmcv dependency version

* Add code info in some metafiles
2021-11-02 18:08:30 +08:00
Ma Zerun 72cffac7b5
Bump version to v0.17.0 (#503) 2021-10-29 14:04:03 +08:00
Ma Zerun fffa30dd48
[Feature] Add Tokens-to-Token ViT backbone and converted checkpoints. (#467)
* add t2t backbone

* register t2t_vit

* add t2t_vit config

* [Temp] Align posterize transform with timm.

* Fix lint

* Refactor t2t-vit

* Add config for t2t-vit

* Add metafile and README for t2t-vit

* Add unit tests

* configs

* Update metafile and README

* Improve docstring

* Fix batch size which should be 8x64 instead of 8x128

* Fix typo

* Update model zoo

* Update training augments config.

* Move some arguments of T2TModule to T2TViT

* Update docs.

* Update unit test

Co-authored-by: HIT-cwh <2892770585@qq.com>
2021-10-29 10:37:16 +08:00
Ezra-Yu 2ce5825ef1
[Feature] Support ImageNet21k dataset. (#461)
* add imagnet21k

* Update unit test

* update imaenet21k

* use slots

* use slots

* rename Data_item to ImageInfo

* add unit tests

* Update unit tests

* rm some print

* update unit tests

* fix lint

* remove default value of pipeline
2021-10-28 15:22:08 +08:00
imyhxy 671414becb
[Fix] Fix missing import `Compose` and `Normalize`.
* Fixed missing import 'Compose'

* Fixed mistype `Compose` in `mmcls/datasets/__init__.py`

* Fixed missing import `Normalize`

* [Docs] Fix typos in doctest

* [Fix] Sort import module
2021-10-28 15:21:05 +08:00
Youqing Xiaozhua 1177feb05b
[Fix] Remove `DistSamplerSeedHook` if use `IterBasedRunner`. (#501)
* remove DistSamplerSeedHook for IterBasedRunner

* Register DistSamplerSeedHook for EpochBasedRunner only

Co-authored-by: Ma Zerun <mzr1996@163.com>

Co-authored-by: Ma Zerun <mzr1996@163.com>
2021-10-27 17:07:33 +08:00
Zhicheng Chen 6d6ce215a2
[Feature] Add seesaw loss. (#500)
* migrate seesaw loss from mmdet

* add assertion and doc string fixes

* add error information

* docstring fixes

* minor doc update
2021-10-27 10:11:59 +08:00
Ma Zerun 77a3834531
[Feature] Add Res2Net backbone and converted weights. (#465)
* Add Res2Net from mmdet, and change it to mmcls style.

* Align structure with official repo

* Support `deep_stem` and `avg_down` option

* Add Res2Net configs

* Add metafile&README and update model zoo

* Add unit tests

* Imporve docstring.

* Improve according to comments.
2021-10-20 16:34:22 +08:00
takuoko f68f17e9bb
[Fix] Set the priority of `EvalHook` to "LOW" to avoid a bug of `IterBasedRunner` (#488)
* Set the priority of EvalHook to LOW.

* add a comment
2021-10-20 16:24:52 +08:00
Ma Zerun 2932f9d8a3
[Refactor] Refator ViT (Continue #295) (#395)
* [Squash] Refator ViT (from #295)

* Use base variable to simplify auto_aug setting

* Use common PatchEmbed, remove HybridEmbed and refactor ViT init
structure.

* Add `output_cls_token` option and change the output format of ViT and
input format of ViT head.

* Update unit tests and add test for `output_cls_token`.

* Support out_indices.

* Standardize config files

* Support resize position embedding.

* Add readme file of vit

* Rename config file

* Improve docs about ViT.

* Update docstring

* Use local version `MultiheadAttention` instead of mmcv version.

* Fix MultiheadAttention

* Support `qk_scale` argument in `MultiheadAttention`

* Improve docs and change `layer_cfg` to `layer_cfgs` and support
sequence.

* Use init_cfg to init Linear layer in VisionTransformerHead

* update metafile

* Update checkpoints and configs

* Imporve docstring.

* Update README

* Revert GAP modification.
2021-10-18 16:07:00 +08:00