Factory
The factory provides a simple interface for creating components from encoders and backbones saved to the registry.
build_model(cfg)
Build the model components (encoder and backbone) based on the configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cfg
|
The configuration object containing model parameters. Should include: - device (str), model.dtype (torch.dtype) - encoder.name (str), encoder.kwargs (dict) - backbone.name (str), backbone.kwargs (dict) |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Tuple |
(BFModule, BFModule)
|
The encoder and backbone modules. |
Source code in bfm/model/factory.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | |