Skip to content

Commit

Permalink
update imagenet weights path
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiyangZhou committed May 28, 2019
1 parent 21171eb commit 9963cff
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions torchreid/models/mlfn.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

model_urls = {
# training epoch = 5, top1 = 51.6
'imagenet': 'http://www.eecs.qmul.ac.uk/~kz303/deep-person-reid/model-zoo/imagenet-pretrained/mlfn-9cb5a267.pth.tar',
'imagenet': 'https://mega.nz/#!YHxAhaxC!yu9E6zWl0x5zscSouTdbZu8gdFFytDdl-RAdD2DEfpk',
}


Expand Down Expand Up @@ -209,5 +209,7 @@ def init_pretrained_weights(model, model_url):
def mlfn(num_classes, loss='softmax', pretrained=True, **kwargs):
model = MLFN(num_classes, loss, **kwargs)
if pretrained:
init_pretrained_weights(model, model_urls['imagenet'])
#init_pretrained_weights(model, model_urls['imagenet'])
import warnings
warnings.warn('The imagenet pretrained weights need to be manually downloaded from {}'.format(model_urls['imagenet']))
return model
12 changes: 8 additions & 4 deletions torchreid/models/mobilenetv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

model_urls = {
# 1.0: top-1 71.3
'mobilenetv2_1dot0': 'http://eecs.qmul.ac.uk/~kz303/deep-person-reid/model-zoo/imagenet-pretrained/mobilenetv2_1.0-0f96a698.pth',
'mobilenetv2_1dot0': 'https://mega.nz/#!NKp2wAIA!1NH1pbNzY_M2hVk_hdsxNM1NUOWvvGPHhaNr-fASF6c',
# 1.4: top-1 73.9
'mobilenetv2_1dot4': 'http://eecs.qmul.ac.uk/~kz303/deep-person-reid/model-zoo/imagenet-pretrained/mobilenetv2_1.4-bc1cc36b.pth',
'mobilenetv2_1dot4': 'https://mega.nz/#!RGhgEIwS!xN2s2ZdyqI6vQ3EwgmRXLEW3khr9tpXg96G9SUJugGk',
}


Expand Down Expand Up @@ -210,7 +210,9 @@ def mobilenetv2_1dot0(num_classes, loss, pretrained=True, **kwargs):
**kwargs
)
if pretrained:
init_pretrained_weights(model, model_urls['mobilenetv2_1dot0'])
#init_pretrained_weights(model, model_urls['mobilenetv2_1dot0'])
import warnings
warnings.warn('The imagenet pretrained weights need to be manually downloaded from {}'.format(model_urls['mobilenetv2_1dot0']))
return model


Expand All @@ -224,5 +226,7 @@ def mobilenetv2_1dot4(num_classes, loss, pretrained=True, **kwargs):
**kwargs
)
if pretrained:
init_pretrained_weights(model, model_urls['mobilenetv2_1dot4'])
#init_pretrained_weights(model, model_urls['mobilenetv2_1dot4'])
import warnings
warnings.warn('The imagenet pretrained weights need to be manually downloaded from {}'.format(model_urls['mobilenetv2_1dot4']))
return model
6 changes: 4 additions & 2 deletions torchreid/models/shufflenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

model_urls = {
# training epoch = 90, top1 = 61.8
'imagenet': 'http://www.eecs.qmul.ac.uk/~kz303/deep-person-reid/model-zoo/imagenet-pretrained/shufflenet-bee1b265.pth.tar',
'imagenet': 'https://mega.nz/#!RDpUlQCY!tr_5xBEkelzDjveIYBBcGcovNCOrgfiJO9kiidz9fZM',
}


Expand Down Expand Up @@ -161,5 +161,7 @@ def init_pretrained_weights(model, model_url):
def shufflenet(num_classes, loss='softmax', pretrained=True, **kwargs):
model = ShuffleNet(num_classes, loss, **kwargs)
if pretrained:
init_pretrained_weights(model, model_urls['imagenet'])
#init_pretrained_weights(model, model_urls['imagenet'])
import warnings
warnings.warn('The imagenet pretrained weights need to be manually downloaded from {}'.format(model_urls['imagenet']))
return model

0 comments on commit 9963cff

Please sign in to comment.