from.resnet_fpnimportResNetFPN_8_2,ResNetFPN_16_4defbuild_backbone(config):ifconfig['backbone_type']=='ResNetFPN':ifconfig['resolution']==(8,2):returnResNetFPN_8_2(config['resnetfpn'])elifconfig['resolution']==(16,4):returnResNetFPN_16_4(config['resnetfpn'])else:raiseValueError(f"LOFTR.BACKBONE_TYPE {config['backbone_type']} not supported.")