|
33 | 33 | from mmengine.registry import Registry
|
34 | 34 |
|
35 | 35 | # manage all kinds of runners like `EpochBasedRunner` and `IterBasedRunner`
|
36 |
| -RUNNERS = Registry('runner', parent=MMENGINE_RUNNERS) |
| 36 | +RUNNERS = Registry( |
| 37 | + 'runner', parent=MMENGINE_RUNNERS, locations=['mmdet3d.engine.runner']) |
37 | 38 | # manage runner constructors that define how to initialize runners
|
38 | 39 | RUNNER_CONSTRUCTORS = Registry(
|
39 |
| - 'runner constructor', parent=MMENGINE_RUNNER_CONSTRUCTORS) |
| 40 | + 'runner constructor', |
| 41 | + parent=MMENGINE_RUNNER_CONSTRUCTORS, |
| 42 | + locations=['mmdet3d.engine.runner']) |
40 | 43 | # manage all kinds of loops like `EpochBasedTrainLoop`
|
41 |
| -LOOPS = Registry('loop', parent=MMENGINE_LOOPS) |
| 44 | +LOOPS = Registry( |
| 45 | + 'loop', parent=MMENGINE_LOOPS, locations=['mmdet3d.engine.runner']) |
42 | 46 | # manage all kinds of hooks like `CheckpointHook`
|
43 |
| -HOOKS = Registry('hook', parent=MMENGINE_HOOKS) |
| 47 | +HOOKS = Registry( |
| 48 | + 'hook', parent=MMENGINE_HOOKS, locations=['mmdet3d.engine.hooks']) |
44 | 49 |
|
45 | 50 | # manage data-related modules
|
46 |
| -DATASETS = Registry('dataset', parent=MMENGINE_DATASETS) |
47 |
| -DATA_SAMPLERS = Registry('data sampler', parent=MMENGINE_DATA_SAMPLERS) |
48 |
| -TRANSFORMS = Registry('transform', parent=MMENGINE_TRANSFORMS) |
| 51 | +DATASETS = Registry( |
| 52 | + 'dataset', parent=MMENGINE_DATASETS, locations=['mmdet3d.datasets']) |
| 53 | +DATA_SAMPLERS = Registry( |
| 54 | + 'data sampler', |
| 55 | + parent=MMENGINE_DATA_SAMPLERS, |
| 56 | + locations=['mmdet3d.datasets.samplers']) |
| 57 | +TRANSFORMS = Registry( |
| 58 | + 'transform', |
| 59 | + parent=MMENGINE_TRANSFORMS, |
| 60 | + locations=['mmdet3d.datasets.transforms']) |
49 | 61 |
|
50 | 62 | # mangage all kinds of modules inheriting `nn.Module`
|
51 |
| -MODELS = Registry('model', parent=MMENGINE_MODELS) |
| 63 | +MODELS = Registry( |
| 64 | + 'model', parent=MMENGINE_MODELS, locations=['mmdet3d.models']) |
52 | 65 | # mangage all kinds of model wrappers like 'MMDistributedDataParallel'
|
53 |
| -MODEL_WRAPPERS = Registry('model_wrapper', parent=MMENGINE_MODEL_WRAPPERS) |
| 66 | +MODEL_WRAPPERS = Registry( |
| 67 | + 'model_wrapper', |
| 68 | + parent=MMENGINE_MODEL_WRAPPERS, |
| 69 | + locations=['mmdet3d.models']) |
54 | 70 | # mangage all kinds of weight initialization modules like `Uniform`
|
55 | 71 | WEIGHT_INITIALIZERS = Registry(
|
56 |
| - 'weight initializer', parent=MMENGINE_WEIGHT_INITIALIZERS) |
| 72 | + 'weight initializer', |
| 73 | + parent=MMENGINE_WEIGHT_INITIALIZERS, |
| 74 | + locations=['mmdet3d.models']) |
57 | 75 |
|
58 | 76 | # mangage all kinds of optimizers like `SGD` and `Adam`
|
59 |
| -OPTIMIZERS = Registry('optimizer', parent=MMENGINE_OPTIMIZERS) |
| 77 | +OPTIMIZERS = Registry( |
| 78 | + 'optimizer', |
| 79 | + parent=MMENGINE_OPTIMIZERS, |
| 80 | + locations=['mmdet3d.engine.optimizers']) |
60 | 81 | # manage optimizer wrapper
|
61 |
| -OPTIM_WRAPPERS = Registry('optim wrapper', parent=MMENGINE_OPTIM_WRAPPERS) |
| 82 | +OPTIM_WRAPPERS = Registry( |
| 83 | + 'optim wrapper', |
| 84 | + parent=MMENGINE_OPTIM_WRAPPERS, |
| 85 | + locations=['mmdet3d.engine.optimizers']) |
62 | 86 | # manage constructors that customize the optimization hyperparameters.
|
63 | 87 | OPTIM_WRAPPER_CONSTRUCTORS = Registry(
|
64 | 88 | 'optimizer wrapper constructor',
|
65 |
| - parent=MMENGINE_OPTIM_WRAPPER_CONSTRUCTORS) |
| 89 | + parent=MMENGINE_OPTIM_WRAPPER_CONSTRUCTORS, |
| 90 | + locations=['mmdet3d.engine.optimizers']) |
66 | 91 | # mangage all kinds of parameter schedulers like `MultiStepLR`
|
67 | 92 | PARAM_SCHEDULERS = Registry(
|
68 |
| - 'parameter scheduler', parent=MMENGINE_PARAM_SCHEDULERS) |
| 93 | + 'parameter scheduler', |
| 94 | + parent=MMENGINE_PARAM_SCHEDULERS, |
| 95 | + locations=['mmdet3d.engine.schedulers']) |
69 | 96 | # manage all kinds of metrics
|
70 |
| -METRICS = Registry('metric', parent=MMENGINE_METRICS) |
| 97 | +METRICS = Registry( |
| 98 | + 'metric', parent=MMENGINE_METRICS, locations=['mmdet3d.evaluation']) |
71 | 99 | # manage evaluator
|
72 |
| -EVALUATOR = Registry('evaluator', parent=MMENGINE_EVALUATOR) |
| 100 | +EVALUATOR = Registry( |
| 101 | + 'evaluator', parent=MMENGINE_EVALUATOR, locations=['mmdet3d.evaluation']) |
73 | 102 |
|
74 | 103 | # manage task-specific modules like anchor generators and box coders
|
75 |
| -TASK_UTILS = Registry('task util', parent=MMENGINE_TASK_UTILS) |
| 104 | +TASK_UTILS = Registry( |
| 105 | + 'task util', parent=MMENGINE_TASK_UTILS, locations=['mmdet3d.models']) |
76 | 106 |
|
77 | 107 | # manage visualizer
|
78 |
| -VISUALIZERS = Registry('visualizer', parent=MMENGINE_VISUALIZERS) |
| 108 | +VISUALIZERS = Registry( |
| 109 | + 'visualizer', |
| 110 | + parent=MMENGINE_VISUALIZERS, |
| 111 | + locations=['mmdet3d.visualization']) |
79 | 112 | # manage visualizer backend
|
80 |
| -VISBACKENDS = Registry('vis_backend', parent=MMENGINE_VISBACKENDS) |
| 113 | +VISBACKENDS = Registry( |
| 114 | + 'vis_backend', |
| 115 | + parent=MMENGINE_VISBACKENDS, |
| 116 | + locations=['mmdet3d.visualization']) |
81 | 117 |
|
82 | 118 | # manage logprocessor
|
83 |
| -LOG_PROCESSORS = Registry('log_processor', parent=MMENGINE_LOG_PROCESSORS) |
| 119 | +LOG_PROCESSORS = Registry( |
| 120 | + 'log_processor', |
| 121 | + parent=MMENGINE_LOG_PROCESSORS, |
| 122 | + # TODO: update the location when mmdet3d has its own log processor |
| 123 | + locations=['mmdet3d.engine']) |
84 | 124 |
|
85 | 125 | # manage inferencer
|
86 |
| -INFERENCERS = Registry('inferencer', parent=MMENGINE_INFERENCERS) |
| 126 | +INFERENCERS = Registry( |
| 127 | + 'inferencer', |
| 128 | + parent=MMENGINE_INFERENCERS, |
| 129 | + locations=['mmdet3d.api.inferencers']) |
0 commit comments