Commit Graph

11 Commits (9613c7684408c4ca0c4a1448d0972b7ecb3564db)

Author SHA1 Message Date
Ross Wightman d6da4fb01e Add forward_intermediates() to efficientnet / mobilenetv3 based models as an exercise. 2024-05-02 14:19:16 -07:00
LittleNyima ef72c3cd47 Add warnings for duplicate registry names 2023-11-08 10:18:59 -08:00
Ross Wightman 35c94b836c Update warning message for deprecated model names 2023-04-05 17:24:17 -07:00
Ross Wightman b3e816d6d7 Improve filtering behaviour for tag + non-tagged model wildcard consistency. 2023-03-22 10:21:22 -07:00
Ross Wightman 49b9c3be80 Include pretrained tag in deprecated mapping warning 2023-03-19 21:21:19 -07:00
Ross Wightman 572f05096a Swin and FocalNet weights on HF hub. Add model deprecation functionality w/ some registry tweaks. 2023-03-18 14:55:09 -07:00
Benjamin Bossan a5b01ec04e Add type annotations to _registry.py
Description

Add type annotations to _registry.py so that they will pass mypy
--strict.

Comment

I was reading the code and felt that this module would be easier to
understand with type annotations. Therefore, I went ahead and added the
annotations.

The idea with this PR is to start small to see if we can align on _how_
to annotate types. I've seen people in the past disagree on how strictly
to annotate the code base, so before spending too much time on this, I
wanted to check if you agree, Ross.

Most of the added types should be straightforward. Some notes on the
non-trivial changes:

- I made no assumption about the fn passed to register_model, but maybe
  the type could be stricter. Are all models nn.Modules?
- If I'm not mistaken, the type hint for get_arch_name was incorrect
- I had to add a # type: ignore to model.__all__ = ...
- I made some minor code changes to list_models to facilitate the
  typing. I think the changes should not affect the logic of the function.
- I removed list from list(sorted(...)) because sorted returns always a
  list.
2023-02-22 09:19:30 -08:00
Ross Wightman 9a51e4ea2e Add FlexiViT models and weights, refactoring, push more weights
* push all vision_transformer*.py weights to HF hub
* finalize more pretrained tags for pushed weights
* refactor pos_embed files and module locations, move some pos embed modules to layers
* tweak hf hub helpers to aid bulk uploading and updating
2022-12-22 17:23:09 -08:00
Ross Wightman 6a01101905 Update efficientnet.py and convnext.py to multi-weight, add ImageNet-12k pretrained EfficientNet-B5 and ConvNeXt-Nano. 2022-12-14 20:33:23 -08:00
Ross Wightman cda39b35bd Add a deprecation phase to module re-org 2022-12-09 14:39:45 -08:00
Ross Wightman 927f031293 Major module / path restructure, timm.models.layers -> timm.layers, add _ prefix to all non model modules in timm.models 2022-12-06 15:00:06 -08:00