Registry is a great design, but when the project become more and more huge, such a static design requires us to import all the python files which contains Registry.
So this is a compromise solution which I call LazyRegistry.
The LazyRegistry only register all modules for the first time, and it does not map the string to object any more, instead it will map the string to string, such as ResNet -> src.modeling.bacbone.ResNet.
It will dump all Registry to binary cached file into default cache_dir.
Before parsing configs, the cached file will be loaded.
Registry
is a great design, but when the project become more and more huge, such a static design requires us to import all the python files which containsRegistry
. So this is a compromise solution which I callLazyRegistry
. TheLazyRegistry
only register all modules for the first time, and it does not map the string to object any more, instead it will map the string to string, such asResNet
->src.modeling.bacbone.ResNet
. It will dump allRegistry
to binary cached file into default cache_dir. Before parsing configs, the cached file will be loaded.