PyTorch Image Models
What's New
❗Updates after Oct 10, 2022 are available in version >= 0.9❗
- Many changes since the last 0.6.x stable releases. They were previewed in 0.8.x dev releases but not everyone transitioned.
timm.models.layers
moved to timm.layers
:
from timm.models.layers import name
will still work via deprecation mapping (but please transition to timm.layers
).
import timm.models.layers.module
or from timm.models.layers.module import name
needs to be changed now.
- Builder, helper, non-model modules in
timm.models
have a _
prefix added, ie timm.models.helpers
-> timm.models._helpers
, there are temporary deprecation mapping files but those will be removed.
- All models now support
architecture.pretrained_tag
naming (ex resnet50.rsb_a1
).
- The pretrained_tag is the specific weight variant (different head) for the architecture.
- Using only
architecture
defaults to the first weights in the default_cfgs for that model architecture.
- In adding pretrained tags, many model names that existed to differentiate were renamed to use the tag (ex:
vit_base_patch16_224_in21k
-> vit_base_patch16_224.augreg_in21k
). There are deprecation mappings for these.
- A number of models had their checkpoints remaped to match architecture changes needed to better support
features_only=True
, there are checkpoint_filter_fn
methods in any model module that was remapped. These can be passed to timm.models.load_checkpoint(..., filter_fn=timm.models.swin_transformer_v2.checkpoint_filter_fn)
to remap your existing checkpoint.
- The Hugging Face Hub (https://huggingface.co/timm) is now the primary source for
timm
weights. Model cards include link to papers, original source, license.
- Previous 0.6.x can be cloned from 0.6.x branch or installed via pip with version.
Aug 8, 2024
July 28, 2024
- Add
mobilenet_edgetpu_v2_m
weights w/ ra4
mnv4-small based recipe. 80.1% top-1 @ 224 and 80.7 @ 256.
- Release 1.0.8
July 26, 2024
- More MobileNet-v4 weights, ImageNet-12k pretrain w/ fine-tunes, and anti-aliased ConvLarge models
- Prototype of
set_input_size()
added to vit and swin v1/v2 models to allow changing image size, patch size, window size after model creation.
- Improved support in swin for different size handling, in addition to
set_input_size
, always_partition
and strict_img_size
args have been added to __init__
to allow more flexible input size constraints
- Fix out of order indices info for intermediate 'Getter' feature wrapper, check out or range indices for same.
- Add several
tiny
< .5M param models for testing that are actually trained on ImageNet-1k
model | top1 | top1_err | top5 | top5_err | param_count | img_size | crop_pct |
---|
test_efficientnet.r160_in1k | 47.156 | 52.844 | 71.726 | 28.274 | 0.36 | 192 | 1.0 |
test_byobnet.r160_in1k | 46.698 | 53.302 | 71.674 | 28.326 | 0.46 | 192 | 1.0 |
test_efficientnet.r160_in1k | 46.426 | 53.574 | 70.928 | 29.072 | 0.36 | 160 | 0.875 |
test_byobnet.r160_in1k | 45.378 | 54.622 | 70.572 | 29.428 | 0.46 | 160 | 0.875 |
test_vit.r160_in1k | 42.0 | 58.0 | 68.664 | 31.336 | 0.37 | 192 | 1.0 |
test_vit.r160_in1k | 40.822 | 59.178 | 67.212 | 32.788 | 0.37 | 160 | 0.875 |
- Fix vit reg token init, thanks Promisery
- Other misc fixes
June 24, 2024
- 3 more MobileNetV4 hyrid weights with different MQA weight init scheme
- florence2 weight loading in DaViT model
June 12, 2024
- MobileNetV4 models and initial set of
timm
trained weights added: