Commit Graph

551 Commits (df6edd7f5a53cd6fa3a5c979fddf542fa926c671)
 

Author SHA1 Message Date
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
Ezra-Yu 52e62560d4
[Feature] Add a tool to find broken files. (#482)
* add verify dataset

* add phase

* rm attr of single_process

* Use `mmcv.track_parallel_progress` to track the validation.

Co-authored-by: mzr1996 <mzr1996@163.com>
2021-10-27 10:14:19 +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 54ef176235
[Docs] Add English Colab tutorials. (#497)
* Add English-version Colab tutorials

* Revise Chinese-version Colab tutorials.

* Add colab tutorials menu on readthedocs page.

* Fix lint
2021-10-26 17:40:24 +08:00
Ezra-Yu 3a35b6f956
[Docs] Add tutuorial for config. (#487)
* add cn tutorials/config.md

* add heads api and doc title link

* Update tutorials index

* Update tutorials index

* Update config.md

* add english version

* Update config.md

* Update docs

* Update css

* Update docs/tutorials/config.md

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

* Update docs_zh-CN/tutorials/config.md

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

* modify according to suggestion

* Use GitHub style `code` css

* change some mmcv API link to CN version

* remove default in default_runtime

Co-authored-by: mzr1996 <mzr1996@163.com>
2021-10-26 16:43:33 +08:00
Ma Zerun 08bf04e5ee
[Fix] Fix bug in `1-benchmark_valid.py` if checkpoint_root is None. (#489) 2021-10-25 12:01:03 +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
Ezra-Yu 9dbe58bf8e
[Feature] Add pipeline visualization tools. (#406)
* add vis

* add tool vis-pipeline

* add docs

* Update docs

* pre-commit

* enhence english expression

* Add `BaseImshowContextmanager` and `ImshowInfosContextManager` to reuse
matplotlib figure.

* Use context manager to implement `imshow_infos`

* Add unit tests.

* More general base context manager.

* unit tests for context manager.

* Improve docstring.

* Fix context manager exit cannot close figure when matplotlib>=3.4.0

* Fix unit tests

* fix lint

* fix lint

* add adaptive

* add adaptive

* update adaptive

* add GAP

* improve doc and docstring

* add visualization in doc index

* Update doc

* Update doc

* Update doc

* Update doc

* Update doc

* Update doc

* update docs and docstring

* add progressbar

* add progressbar

* add images

* add images

* Delete .DS_Store

* replace images

* replace images and modify rgb2bgr

* add picture size

* mv pictures

* update img display

* add doc_zh-CN images

* Update vis_pipeline.py

* Update visualization.md

* Update visualization.md

* fix lint

* Improve docs.

Co-authored-by: mzr1996 <mzr1996@163.com>
2021-10-20 10:28:21 +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
Ezra-Yu 0381309921
[Docs] Update Chinese Colab tutorials. (#483)
* fix *.ipynb

* fix *.ipynb

* fix lint
2021-10-15 17:37:12 +08:00
Ma Zerun 10e8495055
[Tool] Add a tool to test TorchServe. (#468)
* Add `title` option in `show_result_pyplot`.

* Add test_torchserver.py

* Add docs about test torchserve

* Update docs and result output.

* Update chinese docs.
2021-10-14 17:56:32 +08:00
Ma Zerun fd0f5cce92
[Docs] Add model-pages in Model Zoo (#480)
* Add model-pages

* Add shortname in configs

* Use link directly instead of `switch_language.md`

* Auto collapse model-zoo pages.

* Fix link in RegVGG

* Add link replace

* fix lint
2021-10-14 15:26:47 +08:00
Ma Zerun 63a2211315
[Enhance] Add benchmark regression tools (#447) 2021-10-13 17:01:37 +08:00
Tan Y.Q c1b3757ae4
[Fix] Fix a wrong paramter of `get_root_logger` in `apis/train.py`. (#486)
The get_root_logger(log_file=None, log_level=logging.INFO) function does not needs the string type cfg.log_level as input. This bug does not have negative effect.
2021-10-13 14:54:47 +08:00
Ma Zerun 7eeb54ce9c
[Fix] Fix version check in dataset builder. (#474)
* Fix version check in dataset builder.

* Use mmcv version check function.
2021-10-13 14:34:56 +08:00
Ma Zerun 2e6c7cf87d
[Docs] Add code-spell pre-commit hook and fix a large mount of typos. (#470)
* Add code spell check hook

* Add codespell config

* Fix a lot of typos.

* Add formating.py to keep compatibility.
2021-10-13 14:33:07 +08:00
Ma Zerun 6fba107840
[Refactor] Use context manager to reuse matplotlib figures. (#432)
* Add `BaseImshowContextmanager` and `ImshowInfosContextManager` to reuse
matplotlib figure.

* Use context manager to implement `imshow_infos`

* Add unit tests.

* More general base context manager.

* unit tests for context manager.

* Improve docstring.

* Fix context manager exit cannot close figure when matplotlib>=3.4.0

* Fix unit tests

* Support inline backend in visualization.
2021-09-30 13:59:27 +08:00
Ma Zerun 8308636214
Update changelog.md 2021-09-30 13:12:54 +08:00
Ma Zerun 303855998a
Bump version to v0.16.0. (#471)
* Bump version to v0.16.0.

* Fix link

* Imporve changelog

* Add RepVGG models in modelzoo.
2021-09-30 13:12:19 +08:00
Shane Zhao e166ee7c0c
[Fix] Fix format error in `test.py` when metric returns `np.ndarray` (#441)
* Update test.py

Fix the output format error when metric-options is specified

* Update tools/test.py

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

* Update test.py

delete "," after round(out, 2)

* Update test.py

delete else

* Update tools/test.py

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

Co-authored-by: Ma Zerun <mzr1996@163.com>
2021-09-29 11:51:19 +08:00
zhangrui_wolf 90496b4687
[Feature] Add RepVGG backbone and checkpoints. (#414)
* Add RepVGG code.

* Add se_module as plugin.

* Add the repvggA0 primitive config

* Change repvggA0.py to fit mmcls

* Add RepVGG configs

* Add repvgg_to_mmcls

* Add tools/deployment/convert_repvggblock_param_to_deploy.py

* Change configs/repvgg/README.md

* Streamlining the number of configuration files.

* Fix lints

* Delete plugins

* Delete code about plugin.

* Modify the code for using se module.

* Modify config to fit repvgg with se.

* Change se_cfg to allow loading of pre-training parameters.

* Reduce the complexity of the configuration file.

* Finsh unitest for repvgg.

* Fix bug about se in repvgg_to_mmcls.

* Rename convert_repvggblock_param_to_deploy.py to reparameterize_repvgg.py, and delete setting about device.

* test commit

* test commit

* test commit command

* Modify repvgg.py to make the code more readable.

* Add value=0 in F.pad()

* Add se_cfg to arch_settings.

* Fix bug.

* modeify some attr name and Update unit tests

* rename stage_0 to stem and branch_identity to branch_norm

* update unit tests

* add m.eval in unit tests

* [Enhance] Enhence SE layer to support custom squeeze channels. (#417)

* add enhenced SE

* Update

* rm basechannel

* fix docstring

* Update se_layer.py

fix docstring

* [Docs] Add algorithm readme and update meta yml (#418)

* Add README.md for models without checkpoints.

* Update model-index.yml

* Update metafile.yml of seresnet

* [Enhance] Add `hparams` argument in `AutoAugment` and `RandAugment` and some other improvement. (#398)

* Add hparams argument in `AutoAugment` and `RandAugment`.

And `pad_val` supports sequence instead of tuple only.

* Add unit tests for `AutoAugment` and `hparams` in `RandAugment`.

* Use smaller test image to speed up uni tests.

* Use hparams to simplify RandAugment config in swin-transformer.

* Rename augment config name from `pipeline` to `pipelines`.

* Add some commnet ad docstring.

* [Feature] Support classwise weight in losses (#388)

* Add classwise weight in losses:CE,BCE,softBCE

* Update unit test

* rm some extra code

* rm some extra code

* fix broadcast

* fix broadcast

* update unit tests

* use new_tensor

* fix lint

* [Enhance] Better result visualization (#419)

* Imporve result visualization to support wait time and change the backend
to matplotlib.

* Add unit test for visualization

* Add adaptive dpi function

* Rename `imshow_cls_result` to `imshow_infos`.

* Support str in `imshow_infos`

* Improve docstring.

* Bump version to v0.15.0 (#426)

* [CI] Add PyTorch 1.9 and Python 3.9 build workflow, and remove some CI. (#422)

* Add PyTorch 1.9 build workflow, and remove some CI.

* Add Python 3.9 CI

* Show Python 3.9 support.

* [Enhance] Rename the option `--options` in some tools to `--cfg-options`. (#425)

* [Docs] Fix sphinx version (#429)

* [Docs] Add `CITATION.cff` (#428)

* Add CITATION.cff

* Fix typo in setup.py

* Change author in setup.py

* modeify some attr name and Update unit tests

* rename stage_0 to stem and branch_identity to branch_norm

* update unit tests

* add m.eval in unit tests

* Update unit tests

* refactor

* refactor

* Alignment inference accuracy

* Update configs, readme and metafile

* Update readme

* return tuple and fix metafile

* fix unit test

* rm regnet and classifiers changes

* update auto_aug

* update metafile & readme

* use delattr

* rename cfgs

* Update checkpoint url

* Update readme

* Rename config files.

* Update readme and metafile

* add comment

* Update mmcls/models/backbones/repvgg.py

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

* Update docstring

* Improve docstring.

* Update unittest_testblock

Co-authored-by: Ezra-Yu <1105212286@qq.com>
Co-authored-by: Ma Zerun <mzr1996@163.com>
2021-09-29 11:06:23 +08:00
Ma Zerun 8b7d38b243
[Docs] Update `getting_started.md` and `install.md` and rewrite `finetune.md` (#466)
* Disable auto line-wrap in docs.

* Add model_zoo.md and CONTRIBUTING.md in docs.

* Revise getting_started.md and install.md

* Rewrite finetune.md

* Fix typo

* Imporve `finetune.md`

* Fix `GitHub` link

* Fix a small typo.
2021-09-28 18:05:50 +08:00
Ma Zerun c076a97d54
[Fix] Fix `publish_model` bug if no parent of `out_file`. (#463) 2021-09-26 11:21:19 +08:00
Ma Zerun c5374854aa
[Fix] Fix num_classes bug in pytorch2onnx.py (#458)
* Fix num_classes bug in pytorch2onnx.py

* Fix `num_classes=-1`.
2021-09-25 09:25:58 +08:00
Ma Zerun 1d6d142b42
[Docs] Use PyTorch style docs theme (#457)
* Change docs theme to pytorch-theme

* Update docs rst

* Fix docs title level.

* Add static resources

* Fix lint
2021-09-23 22:21:03 +08:00
RangiLyu 0b20aa6873
[Fix]: Fix missing runtime requirement `packaging`. (#459) 2021-09-23 18:04:42 +08:00
Ma Zerun 75b087f27e
[Refactor] Fix TnT compatibility and verbose warning. (#436)
* Support return tuple in TnT

* Fix verbose warnings.
2021-09-22 19:37:24 +08:00
Ezra-Yu f865c725f2
[Docs] Fix typo in transforms.py docstring (#455) 2021-09-22 11:09:23 +08:00
Charlyo 8024f81de2
[Docs] Fix a typo in transforms (#454) 2021-09-22 10:46:59 +08:00
Ma Zerun 8f68779cc6
[Docs] Update metafile and Readme (#435)
* Update metafile format.

* Update accuracy of checkpoints.

* Add metafile and readme for tnt.

* Add converted ckpts in swin-transformer.

* Fix tnt ckpt link

* Update swin_transformer metafile
2021-09-18 16:32:46 +08:00
Ma Zerun cb09ed54e5
[Enhance] Support setting `--out-items` in `tools/test.py`. (#437)
* Support setting out_details in `tools/test.py`.

* Add assertion in `eval_metric` and `analyze_results`.
2021-09-15 11:06:16 +08:00
yushu 617932dd59
[Fix] Fix simplified model saving in ONNX export tool. (#438)
* Update pytorch2onnx.py

* Update pytorch2onnx.py

Please check the check_ok result.

* Update pytorch2onnx.py

* Update pytorch2onnx.py
2021-09-10 11:47:05 +08:00
Ezra-Yu fe25c8d3fb
[Enchence] Add datetime info and saving model using torch<1.6 format (#439)
* Add date and save ckpt usingg torch<1.6 format

* fix lint

* use digit_version and rasie error when there is no target out_dir

* add '.'
2021-09-10 11:42:38 +08:00
Ma Zerun a8f4f82b8e
[Enhance] Improve downstream repositories compatibility (#421)
* Defaults to return tuple in all backbones.

* Compat downstream of swin transformer.

* Support tuple input for multi label head and stacked head.

* Fix backbone unit tests for tuple output.

* Add downstream inference unit tests for mmdet.

* Update gitignore

* Add unit tests for `return_tuple` option

* Add unit tests for head input tuple.

* Add warning in `simple_test`

* Add TIMMBackbone return tuple.

* Modify timm backbone unit test.
2021-09-08 10:38:57 +08:00
Miras Amir 5cfaed6807
[Feature] timm backbones wrapper (#427)
* Add wrapper to use backbones from timm

* Add tests

* Remove timm from optional deps and modify GitHub workflow.

Co-authored-by: mzr1996 <mzr1996@163.com>
2021-09-06 11:05:31 +08:00
Ma Zerun 729c6c1192
[Docs] Add `CITATION.cff` (#428)
* Add CITATION.cff

* Fix typo in setup.py

* Change author in setup.py
2021-09-01 17:07:27 +08:00
Ma Zerun 0d0b1f5f92
[Docs] Fix sphinx version (#429) 2021-09-01 17:07:08 +08:00
Ma Zerun ae40c45c55
[Enhance] Rename the option `--options` in some tools to `--cfg-options`. (#425) 2021-09-01 12:49:03 +08:00
Ma Zerun 5aa132a91c
[CI] Add PyTorch 1.9 and Python 3.9 build workflow, and remove some CI. (#422)
* Add PyTorch 1.9 build workflow, and remove some CI.

* Add Python 3.9 CI

* Show Python 3.9 support.
2021-09-01 11:06:00 +08:00
Ma Zerun a41cb2fa93
Bump version to v0.15.0 (#426) 2021-08-31 14:33:32 +08:00
Ma Zerun 5383787512
[Enhance] Better result visualization (#419)
* Imporve result visualization to support wait time and change the backend
to matplotlib.

* Add unit test for visualization

* Add adaptive dpi function

* Rename `imshow_cls_result` to `imshow_infos`.

* Support str in `imshow_infos`

* Improve docstring.
2021-08-31 10:50:28 +08:00
Ezra-Yu 192b79eea0
[Feature] Support classwise weight in losses (#388)
* Add classwise weight in losses:CE,BCE,softBCE

* Update unit test

* rm some extra code

* rm some extra code

* fix broadcast

* fix broadcast

* update unit tests

* use new_tensor

* fix lint
2021-08-31 10:44:12 +08:00
Ma Zerun 6a0a76af0c
[Enhance] Add `hparams` argument in `AutoAugment` and `RandAugment` and some other improvement. (#398)
* Add hparams argument in `AutoAugment` and `RandAugment`.

And `pad_val` supports sequence instead of tuple only.

* Add unit tests for `AutoAugment` and `hparams` in `RandAugment`.

* Use smaller test image to speed up uni tests.

* Use hparams to simplify RandAugment config in swin-transformer.

* Rename augment config name from `pipeline` to `pipelines`.

* Add some commnet ad docstring.
2021-08-24 18:15:54 +08:00
Ma Zerun a9d65271ab
[Docs] Add algorithm readme and update meta yml (#418)
* Add README.md for models without checkpoints.

* Update model-index.yml

* Update metafile.yml of seresnet
2021-08-24 17:46:46 +08:00
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