Skip to content

Commit

Permalink
Change S3 to Wasabi URL (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanghang1989 authored Jun 28, 2020
1 parent c4ea0c0 commit c9aa6f4
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
- name: Run pytest
run: |
nosetests -v tests/
for f in tests/*.py; do python "$f"; done
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![PyPI](https://img.shields.io/pypi/v/resnest.svg)](https://pypi.python.org/pypi/resnest)
[![PyPI Pre-release](https://img.shields.io/badge/pypi--prerelease-v0.0.4-ff69b4.svg)](https://pypi.org/project/resnest/#history)
[![PyPI Pre-release](https://img.shields.io/badge/pypi--prerelease-v0.0.5-ff69b4.svg)](https://pypi.org/project/resnest/#history)
[![PyPI Nightly](https://github.com/zhanghang1989/ResNeSt/workflows/Pypi%20Nightly/badge.svg)](https://github.com/zhanghang1989/ResNeSt/actions)
[![Downloads](http://pepy.tech/badge/resnest)](http://pepy.tech/project/resnest)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
Expand Down
4 changes: 2 additions & 2 deletions resnest/gluon/model_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
('7318153ddb5e542a20cc6c58192f3c6209cff9ed', 'resnest50_fast_1s4x24d'),
]}

encoding_repo_url = 'https://hangzh.s3-us-west-1.amazonaws.com/'
_url_format = '{repo_url}gluon/models/{file_name}.zip'
encoding_repo_url = 'https://s3.us-west-1.wasabisys.com/resnest/'
_url_format = '{repo_url}gluon/{file_name}.zip'

def short_hash(name):
if name not in _model_sha1:
Expand Down
2 changes: 1 addition & 1 deletion resnest/torch/ablation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'resnest50_fast_1s2x40d', 'resnest50_fast_2s2x40d', 'resnest50_fast_4s2x40d',
'resnest50_fast_1s4x24d']

_url_format = 'https://hangzh.s3.amazonaws.com/encoding/models/{}-{}.pth'
_url_format = 'https://s3.us-west-1.wasabisys.com/resnest/torch/{}-{}.pth'

_model_sha256 = {name: checksum for checksum, name in [
('d8fbf808', 'resnest50_fast_1s1x64d'),
Expand Down
2 changes: 1 addition & 1 deletion resnest/torch/resnest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

__all__ = ['resnest50', 'resnest101', 'resnest200', 'resnest269']

_url_format = 'https://s3.us-west-1.wasabisys.com/resnest/{}-{}.pth'
_url_format = 'https://s3.us-west-1.wasabisys.com/resnest/torch/{}-{}.pth'

_model_sha256 = {name: checksum for checksum, name in [
('528c19ca', 'resnest50'),
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

cwd = os.path.dirname(os.path.abspath(__file__))

version = '0.0.4'
version = '0.0.5'
try:
if not os.getenv('RELEASE'):
from datetime import date
Expand Down
28 changes: 28 additions & 0 deletions tests/test_gluon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
## Created by: Hang Zhang
## Email: [email protected]
## Copyright (c) 2020
##
## This source code is licensed under the MIT-style license found in the
## LICENSE file in the root directory of this source tree
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

import mxnet as mx

def test_model_inference():
# get all models
from resnest.gluon.model_store import _model_sha1
from resnest.gluon import get_model

model_list = _model_sha1.keys()

x = mx.random.uniform(shape=(1, 3, 224, 224))
for model_name in model_list:
print('Doing: ', model_name)
model = get_model(model_name, pretrained=True)
y = model(x)

if __name__ == "__main__":
import nose
nose.runmodule()

2 changes: 1 addition & 1 deletion tests/test_radix_major.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def forward(self, x):
atten_k = F.softmax(atten_k, dim=1)
else:
x_k = all_groups[k]
atten_k = F.sigmoid(atten_k)
atten_k = torch.sigmoid(atten_k)
attended_k = x_k * atten_k.view(batch, -1, 1, 1)
out_k = sum(torch.split(attended_k, attended_k.size(1)//self.radix, dim=1))
out.append(out_k)
Expand Down
1 change: 0 additions & 1 deletion tests/test_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ def test_model_inference():
get_model = importlib.import_module('resnest.torch')
x = torch.rand(1, 3, 224, 224)
for model_name in model_list:
if 'fast' in model_name: continue
print('Doing: ', model_name)
net = getattr(get_model, model_name)
model = net(pretrained=True)
Expand Down

0 comments on commit c9aa6f4

Please sign in to comment.