Cadene/pretrained-models.pytorch is one of the AI-powered repositories TopGit tracks, currently at 9.1k stars, written primarily in Python. Pretrained ConvNets for pytorch: NASNet, ResNeXt, ResNet, InceptionV4, InceptionResnetV2, Xception, DPN, etc.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
model_name = 'nasnetalarge' # could be fbresnet152 or inceptionresnetv2
model = pretrainedmodels.__dict__[model_name](num_classes=1000, pretrained='imagenet')
model.eval()
Note: By default, models will be downloaded to your $HOME/.torch folder. You can modify this behavior using the $TORCH_HOME variable as follow: export TORCH_HOME="/local/pretrainedmodels"
To load an image and do a complete forward pass:
import torch
import pretrainedmodels.utils as utils
load_img = utils.LoadImage()
# transformations depending on the model
# rescale, center crop, normalize, and others (ex: ToBGR, ToRange255)
tf_img = utils.TransformImage(model)
path_img = 'data/cat.jpg'
input_img = load_img(path_img)
input_tensor = tf_img(input_img) # 3x400x225 -> 3x299x299 size may differ
input_tensor = input_tensor.unsqueeze(0) # 3x299x299 -> 1x3x299x299
input = torch.autograd.Variable(input_tensor,
requires_grad=False)
output_logits = model(input) # 1x1000
To extract features (beware this API is not available for all networks):
Results were obtained using (center cropped) images of the same size than during the training process.
Model
Version
Acc@1
Acc@5
PNASNet-5-Large
Tensorflow
82.858
96.182
PNASNet-5-Large
Our porting
82.736
95.992
NASNet-A-Large
Tensorflow
82.693
96.163
NASNet-A-Large
Our porting
82.566
96.086
SENet154
Caffe
81.32
95.53
SENet154
Our porting
81.304
95.498
PolyNet
Caffe
81.29
95.75
PolyNet
Our porting
81.002
95.624
InceptionResNetV2
Tensorflow
80.4
95.3
InceptionV4
Tensorflow
80.2
95.3
SE-ResNeXt101_32x4d
Our porting
80.236
95.028
SE-ResNeXt101_32x4d
Caffe
80.19
95.04
InceptionResNetV2
Our porting
80.170
95.234
InceptionV4
Our porting
80.062
94.926
DualPathNet107_5k
Our porting
79.746
94.684
ResNeXt101_64x4d
Torch7
79.6
94.7
DualPathNet131
Our porting
79.432
94.574
DualPathNet92_5k
Our porting
79.400
94.620
DualPathNet98
Our porting
79.224
94.488
SE-ResNeXt50_32x4d
Our porting
79.076
94.434
SE-ResNeXt50_32x4d
Caffe
79.03
94.46
Xception
Keras
79.000
94.500
ResNeXt101_64x4d
Our porting
78.956
94.252
Xception
Our porting
78.888
94.292
ResNeXt101_32x4d
Torch7
78.8
94.4
SE-ResNet152
Caffe
78.66
94.46
SE-ResNet152
Our porting
78.658
94.374
ResNet152
Pytorch
78.428
94.110
SE-ResNet101
Our porting
78.396
94.258
SE-ResNet101
Caffe
78.25
94.28
ResNeXt101_32x4d
Our porting
78.188
93.886
FBResNet152
Torch7
77.84
93.84
SE-ResNet50
Caffe
77.63
93.64
SE-ResNet50
Our porting
77.636
93.752
DenseNet161
Pytorch
77.560
93.798
ResNet101
Pytorch
77.438
93.672
FBResNet152
Our porting
77.386
93.594
InceptionV3
Pytorch
77.294
93.454
DenseNet201
Pytorch
77.152
93.548
DualPathNet68b_5k
Our porting
77.034
93.590
CaffeResnet101
Caffe
76.400
92.900
CaffeResnet101
Our porting
76.200
92.766
DenseNet169
Pytorch
76.026
92.992
ResNet50
Pytorch
76.002
92.980
DualPathNet68
Our porting
75.868
92.774
DenseNet121
Pytorch
74.646
92.136
VGG19_BN
Pytorch
74.266
92.066
NASNet-A-Mobile
Tensorflow
74.0
91.6
NASNet-A-Mobile
Our porting
74.080
91.740
ResNet34
Pytorch
73.554
91.456
BNInception
Our porting
73.524
91.562
VGG16_BN
Pytorch
73.518
91.608
VGG19
Pytorch
72.080
90.822
VGG16
Pytorch
71.636
90.354
VGG13_BN
Pytorch
71.508
90.494
VGG11_BN
Pytorch
70.452
89.818
ResNet18
Pytorch
70.142
89.274
VGG13
Pytorch
69.662
89.264
VGG11
Pytorch
68.970
88.746
SqueezeNet1_1
Pytorch
58.250
80.800
SqueezeNet1_0
Pytorch
58.108
80.428
Alexnet
Pytorch
56.432
79.194
Notes:
the Pytorch version of ResNet152 is not a porting of the Torch7 but has been retrained by facebook.
For the PolyNet evaluation each image was resized to 378x378 without preserving the aspect ratio and then the central 331×331 patch from the resulting image was used.
Beware, the accuracy reported here is not always representative of the transferable capacity of the network on other tasks and datasets. You must try them all! :P
The porting has been made possible by Ross Wightman in his PyTorch repo.
As you can see here DualPathNetworks allows you to try different scales. The default one in this repo is 0.875 meaning that the original input size is 256 before croping to 224.
How active is development on Cadene/pretrained-models.pytorch?
The most recent commit recorded on Cadene/pretrained-models.pytorch was 4.3 years ago, based on the GitHub push timestamp. The repository has 1.8k forks — one of the better signals of community interest.
How many stars does Cadene/pretrained-models.pytorch have?
Cadene/pretrained-models.pytorch has 9.1k GitHub stars — refresh the page for the live number, or check github.com/Cadene/pretrained-models.pytorch. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is Cadene/pretrained-models.pytorch open source?
Yes — Cadene/pretrained-models.pytorch ships under the BSD-3-Clause license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/Cadene/pretrained-models.pytorch.
What else is in the AI Tools space?
Cadene/pretrained-models.pytorch is tracked by TopGit under the AI Tools category, alongside 6 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is Cadene/pretrained-models.pytorch?
Cadene/pretrained-models.pytorch (Cadene/pretrained-models.pytorch) is a Python project on GitHub. From the project's own README: Pretrained ConvNets for pytorch: NASNet, ResNeXt, ResNet, InceptionV4, InceptionResnetV2, Xception, DPN, etc.
What language is Cadene/pretrained-models.pytorch written in?
Cadene/pretrained-models.pytorch is written primarily in Python. GitHub's language field is based on the largest share of bytes in the default branch.
What license does Cadene/pretrained-models.pytorch use?
Cadene/pretrained-models.pytorch is released under the BSD-3-Clause license. Always verify the LICENSE file directly on GitHub for the authoritative terms — license strings can be edited out of sync with a project's actual stance.
Where do I read more about Cadene/pretrained-models.pytorch?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/Cadene/pretrained-models.pytorch is the definitive source.
Read full README in the tab above.
Still deciding about pretrained-models.pytorch?
One click hands the question to an AI along with this page — see what it says about pretrained-models.pytorch.