Commit Graph

196 Commits (a5a9fe30a92a0a9f406365be670c09a47308d297)

Author SHA1 Message Date
wemoveon2 c71ed86d0e
mmcv.runner -> mmengine.runner 2024-09-25 15:16:02 -04:00
wemoveon2 27a9e91269
use mmengine config 2024-09-24 18:25:00 -04:00
Harmit Minhas 3b5052d777 add normalize in graph option 2022-04-25 17:18:41 -04:00
Ma Zerun 702c196514
[Docs] Refine API reference. (#774)
* [Docs] Refine API reference

* Add PoolFormer
2022-04-15 20:19:20 +08:00
mzr1996 29b882d4eb Merge branch 'dev' 2022-04-15 20:10:45 +08:00
Weihao Yu 2eb27d0d4e
[Feature] Add PoolFormer backbone and checkpoints. (#746)
* add PoolFormer

* fix some typos in PoolFormer

* fix lint error

* modify out_indices and gap

* fix typo

* fix lint

* fix typo

* fix typo in poolforemr README

* fix lint

* Update some paths

* Refactor freeze_stages method

* Add unit tests

* Fix lint

Co-authored-by: mzr1996 <mzr1996@163.com>
2022-04-15 11:35:15 +08:00
Yuan Liu fbcf907dc6
[Feature] Support resize relative position embedding in `SwinTransformer`. (#749)
* [Feature]: Add resize rel pos embed

* [Refactor]: Create a separated resize_rel_pos_bias_table func

* [Refactor]: Refactor rel pos embed bias

* [Refactor]: Move interpolate into func

* Remove index buffer only when window_size changes

Co-authored-by: mzr1996 <mzr1996@163.com>
2022-04-13 23:06:56 +08:00
XiaobingZhang 875195efe9
[Enhance] Improve CPE performance by reduce memory copy. (#762) 2022-04-02 11:12:20 +08:00
Ezra-Yu 922a31a68e
[Feature] ADD RepMLP Backbone and checkpoints. (#709)
* add repmlp

* refactor backbone code

* add checkpoint, readme, unit tests

* unchange demo

* improve docstring.

* update pic

* refactor patch embed

* refactor unit tests

* fix lint

* update tools

* update tools

* Update checkpoint path

Co-authored-by: mzr1996 <mzr1996@163.com>
2022-03-30 20:40:25 +08:00
Ezra-Yu 292127098f
[Feature] Add CSPNet and backbone and checkpoints (#735)
* add cspnet backbone

* try

* add backbones

* add cspnet

* add acc

* add unit tests

* chnage mode

* Update checkpoint path

* Fix typo

* Imporve CSPNet

* Update checkpoints

Co-authored-by: mzr1996 <mzr1996@163.com>
2022-03-30 15:29:35 +08:00
Ma Zerun 1717efadbe
[Fix] Fix the discontiguous output feature map of ConvNeXt. (#743)
* [Fix] Fix the discontiguous output feature map of ConvNeXt.

* Add comment
2022-03-25 12:34:44 +08:00
Hubert 04cb42a768
[Feature] Support ConvMixer. (#716)
* basic support for ConvMixer

* simplify

* add data pipeine config for timm

* Add model readme and metafile

* add unittest for convmixer

* add copyright

* modify

* add tests

* update model

* add conv2dAdaptivePadding replacement

* update model index

* fix comments

* Update checkpoint path

Co-authored-by: mzr1996 <mzr1996@163.com>
2022-03-23 15:23:57 +08:00
takuoko c1534f9126
[Feature] Support resizemix. (#676)
* add resizemix

* skip torch.__version__ < 1.7.0

* Update mmcls/models/utils/augment/resizemix.py

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

* Update mmcls/models/utils/augment/resizemix.py

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

* resize -> F.interpolate

* fix docs

* fix test

* add Copyright

* add argument interpolation

Co-authored-by: Ma Zerun <mzr1996@163.com>
2022-03-07 12:11:20 +08:00
Ma Zerun c708770b42
[Enhance] Support dynamic input shape for ViT-based algorithms. (#706)
* Move `resize_pos_embed` to `mmcls.models.utils`

* Refactor Vision Transformer

* Refactor DeiT

* Refactor MLP-Mixer

* Refactor Swin-Transformer

* Remove `indexing` arg

* Support dynamic inputs for t2t_vit

* Add copyright

* Fix bugs in swin transformer

* Add `pad_small_maps` option

* Update swin transformer

* Handle `attn_mask` in checkpoints of swin

* Imporve by comments
2022-03-03 13:10:12 +08:00
HumberMe 1214df083d
[Enhance] Use PyTorch official `one_hot` to implement `convert_to_one_hot`. (#696)
* some change to mmcls/models/losses/utils.py:convert_to_one_hot()

* fixed problem: line too long

* fixed wrong output shape

* fixed lint PEP8 E128

* fix lint

* fix lint

* add unit tests

Co-authored-by: Ezra-Yu <1105212286@qq.com>
2022-02-28 10:20:31 +08:00
Ma Zerun 5f7322c211
[Fix] Fix Conformer forward with irregular input size. (#686)
* Auto pad the feature map to be divisible by 4.

* Add unit tests

* Use `trans_down_stride` instead of 4.
2022-02-28 10:17:52 +08:00
Ezra-Yu 7fcaedcbfb
[Feature] Add ResNetV1c. (#692)
* add ResNetV1c

* add unit tests

* fix lint

* update docstring

* fix lint
2022-02-23 11:36:33 +08:00
takuoko 43024cda73
[Feature] Support gem pooling (#677)
* add gem pooling

* add example config

* fix params

* add assert

* add param clamp

* add test assert

* add clamp

* fix conflict
2022-02-17 02:17:36 +08:00
Ma Zerun fcd57913ae
[Enhance] Upgrade isort pre-commit hooks. (#687)
* Use new version flake8 and isort hooks

* Fix missing copyright
2022-02-17 02:17:20 +08:00
Ma Zerun bca695b684
[Refactor] Remove deprecation. (#633)
* Remove deprecated `--options` in some tools

* Remove deprecated eval hooks and fp16 hooks

* Remove deprecated mixup&cutmix, pretrained and return_tuple arguments.

* Remove deprecated `deprecated_options` in multi label dataset

* Remove deprecated `formating.py`

* Remove deprecated default mode of `LabelSmoothLoss`

* Revert pretrained argument, and remove it's deprecation sign.

* Update unit test
2022-02-10 09:30:18 +08:00
Ma Zerun 5de480ea9e
[Feature] Support HRNet and add pre-trained models (#660)
* Support HRNet

* Add HRNet configs

* Fix a bug in backward

* Add configs and update docs.

* Not use bias in conv before batch norm

* Defaults to use `norm_eval=False`

* Add unit tests and support out_channels in HRFuseScales

* Update checkpoint path

* Update docstring.

* Remove incorrect files

* Improve according to comments
2022-01-28 10:54:14 +08:00
Ma Zerun dc456a0c2c
[Feature] Support ConvNeXt (#670)
* Support ConvNeXt

* Add configs of ConvNeXt

* Update dev scripts

* Update docs.

* Use new style README

* Add unit tests.

* Update README

* Imporve according to comments

* Modify refers to timm.

* Imporve according to comments
2022-01-28 10:36:45 +08:00
Ezra-Yu 94eb3ff83e
[Feature] Add Twins backbone and convert checkpoints. (#642)
* add twins backbone

* add position_encoding

* refactor twins

* Supplemental unit tests

* update docstring and readme

* update docstring and readme

* update docstring and readme

* update docstring

* update docstring

* update docstring

* update docstring

* remove note

* update doc and docstring

* update docstring

* update docstring

* use abstract pdf link and rename yamlfile

* Update model link

Co-authored-by: mzr1996 <mzr1996@163.com>
2022-01-27 10:25:05 +08:00
Ezra-Yu bd397f790f
[Enhance] Rewrite channel split operation in ShufflenetV2 (#632)
* replace chunk op

* shufflenetv2 config
2022-01-25 14:45:28 +08:00
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 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
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
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
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
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
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
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
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
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
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
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
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
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