Commit Graph

26 Commits (b638d3b1fe931bed233dae868c7960078ed34899)

Author SHA1 Message Date
Mashiro 6ece63ed35
[Feature] Support Pure Python style Configuration File (#1071) 2023-06-16 12:52:07 +08:00
Qian Zhao b2ad2210b5
[Feature] Support registering partial functions and more (#595)
* support registering partial functions

* Update mmengine/registry/build_functions.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update mmengine/registry/registry.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Revert unit test and refine

* add current logger and set log level

---------

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: HAOCHENYE <21724054@zju.edu.cn>
2023-04-10 19:42:04 +08:00
Mashiro dbae83c52f
[Enhancement] Replace warnings.warn with print_log (#961)
* Replace warning with print_log

* Add comments for testing warning
2023-03-06 17:25:28 +08:00
Zaida Zhou e16dacf7e3
Refine the repr of Registry (#942)
* Refine the repr of Registry

* fix ut

* fix ut
2023-02-21 13:18:11 +08:00
wxDai 1d97c07068
[Docs] Fix typo shedule (#936) 2023-02-19 20:44:24 +08:00
Eiuyc c59899a65a
[Enhance] Beautify the print result of the registry (#922)
* beautify the print result of the registry

* remove tabulate and use rich for repr

* remove table width; text align to left

* sort _model_dict items
2023-02-14 16:32:11 +08:00
RangiLyu e83ac944b6
[Feature] Registry supports import modules automatically. (#643)
* [Feature] Support registry auto import modules.

* update

* rebase and fix ut

* add docstring

* remove count_registered_modules

* update docstring

* resolve comments

* resolve comments

* rename ut

* fix warning

* avoid BC breaking

* update doc

* update doc

* resolve comments
2022-12-23 15:46:29 +08:00
Mashiro c1447734c2
[Enhance] Call `register_all_modules` in `Registry.get()` (#541)
* call register_all_modules  in Registry.get()

* Fix ci

* fix scope bug (scope_name -> scope), for temp sync

* Fix unit test

* Refine log information

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Fix typo

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-10-24 20:15:14 +08:00
Qian Zhao 94412f72d8
[Fix] Exception while building registered function (#491) 2022-08-31 13:53:32 +08:00
Mashiro 33d7c81bc4
[Refactor]: Avoid creating instances with the same name (#483) 2022-08-30 16:28:18 +08:00
Zaida Zhou 2f09342663
[Docs] Refine registry docs (#443)
* [Docs] Refine registry docs

* explain how to use _scope_

* refine
2022-08-29 14:50:48 +08:00
Zaida Zhou 7e1d7af2d9
[Refactor] Refactor code structure (#395)
* Rename data to structure

* adjust the way to import module

* adjust the way to import module

* rename Structure to Data Structures in docs api

* rename structure to structures

* support using some modules of mmengine without torch

* fix circleci config

* fix circleci config

* fix registry ut

* minor fix

* move init method from model/utils to model/weight_init.py

* move init method from model/utils to model/weight_init.py

* move sync_bn to model

* move functions depending on torch to dl_utils

* format import

* fix logging ut

* add weight init in model/__init__.py

* move get_config and get_model to mmengine/hub

* move log_processor.py to mmengine/runner

* fix ut

* Add TimeCounter in dl_utils/__init__.py
2022-08-24 19:14:07 +08:00
Mashiro 7e2302388f
[Feature] add config new feature (#105) 2022-08-08 21:01:06 +08:00
Mashiro a07a063306
[Enhance] Add build function for scheduler. (#372)
* add build function for scheduler

* add unit test

add unit test

* handle convert_to_iter in build_scheduler_from_cfg

* restore deleted code

* format import

* fix lint
2022-08-08 20:34:16 +08:00
Mashiro 6b608b4ef1
[Enhance] Add `build_model_from_cfg` (#328)
* clean code

* fix as comment

* fix as comment

* add get_registry_by_scope method

* add unit test and docstring example

* rename get_registry_by_scope to switch_scope_and_registry

* move build function to registry/builder

* fix docstring

* rename builder->registry_builder, move build_from_cfg to registry_builder

rename builder->registry_builder, move build_from_cfg to registry_builder

* rename registry_builder to build_function

rename registry_builder to build_function

* fix docstring and type hint

* rename build_function to build_functions
2022-07-13 19:01:59 +08:00
Alex Yang 5016332588
[Feat] support registering function (#302) 2022-06-14 14:50:24 +08:00
RangiLyu 2f16ec69fb
[Feature] Support overwrite default scope with "_scope_". (#275)
* [Feature] Support overwrite default scope with "_scope_".

* add ut

* add ut
2022-06-09 20:16:31 +08:00
jbwang1997 38b22d9e68
[Enhance] Enhance error report when a module has been registered in registery. (#264)
* Update

* Add unittest
2022-05-31 11:31:04 +08:00
Zaida Zhou 16058fdb18
[Fix] Fix RecursionError when key is invalid (#220)
* [Fix] Fix RecursionError when key is invalid

* refine comments
2022-05-05 20:09:03 +08:00
RangiLyu 4742544b25
[Feature] Support collect all registered module info. (#193)
* [Feature] Support collect all registered module info.

* update

* update

* add unit tests

* add to runner

* resolve comments
2022-05-05 11:59:51 +08:00
liukuikun 5f8f36e6a5
refactor visualization (#147)
* [WIP] add inline

* refactor vis module

* [Refactor] according review

* [Fix] fix comment

* fix some error

* Get sub visualizer be Visualizer.get_instance

* fix conflict

* fix lint

* fix unit test

* fix mypy

* fix comment

* fix lint

* update docstr

* update

* update instancedata

* remove replace __mro__ with issubclass

Co-authored-by: PJLAB\huanghaian <1286304229@qq.com>
Co-authored-by: HAOCHENYE <21724054@zju.edu.cn>
2022-04-15 15:56:06 +08:00
RangiLyu 25014af3c3
[Refactor] Refactor default_scope in Registry. (#158) 2022-04-01 09:13:55 +08:00
Mashiro 563b4bad16
[Feature] add defaut scope (#149)
* add defaut scope

* Fix docstring

* override get_current_instance method in DefaultScope

clean meta nameing

* remove default mmengine argument of DefaltScope

remove default mmengine argument of DefaltScope

remove default mmengine argument of DefaltScope

* Fix unit test

Fix unit test

* Fix example in docstring

* add explaination of DefaultScope
2022-03-28 23:14:41 +08:00
Zaida Zhou b3d54481fd
[Fix] Fallback to use self registry if default_scope not found (#122) 2022-03-14 00:44:16 +08:00
Zaida Zhou cccd20a636
[Feature] Add Registry (#11) 2022-02-16 21:45:39 +08:00
Zaida Zhou 6ba7ac3a8e
Add the unittest of registry (#5)
* Add the unittest of registry

* improve the format

* fix the test_repr

* refactor the test_init

* add the copyright for tests directory

* add more unit tests

* fix error

* add unit tests for _search_child and _get_root_registry

* build_from_cfg supports dict, ConfictDict and Config

* improve docstring
2022-02-15 15:37:53 +08:00