MCPcopy
hub / github.com/huggingface/pytorch-image-models / pretrained_cfg_for_features

Function pretrained_cfg_for_features

timm/models/_builder.py:291–297  ·  view source on GitHub ↗
(pretrained_cfg: Dict[str, Any])

Source from the content-addressed store, hash-verified

289
290
291def pretrained_cfg_for_features(pretrained_cfg: Dict[str, Any]) -> Dict[str, Any]:
292 pretrained_cfg = deepcopy(pretrained_cfg)
293 # remove default pretrained cfg fields that don't have much relevance for feature backbone
294 to_remove = ('num_classes', 'classifier', 'global_pool') # add default final pool size?
295 for tr in to_remove:
296 pretrained_cfg.pop(tr, None)
297 return pretrained_cfg
298
299
300def _filter_kwargs(kwargs: Dict[str, Any], names: List[str]) -> None:

Callers 5

_create_hrnetFunction · 0.85
_create_mnv3Function · 0.85
_gen_hardcorenasFunction · 0.85
_create_effnetFunction · 0.85
build_model_with_cfgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected