Files
DZGCoOp/Dassl.ProGrad.pytorch/dassl/modeling/backbone/build.py
T
Rain-BusandClaude Opus 4.7 5027694a2b release code
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-10-12 22:30:08 +08:00

12 lines
358 B
Python

from dassl.utils import Registry, check_availability
BACKBONE_REGISTRY = Registry("BACKBONE")
def build_backbone(name, verbose=True, **kwargs):
avai_backbones = BACKBONE_REGISTRY.registered_names()
check_availability(name, avai_backbones)
if verbose:
print("Backbone: {}".format(name))
return BACKBONE_REGISTRY.get(name)(**kwargs)