Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish TinyMS hub module with load and publish feature #86

Merged
merged 2 commits into from
May 14, 2021

Conversation

leonwanghui
Copy link
Contributor

@leonwanghui leonwanghui commented May 13, 2021

What type of PR is this?

/kind enhancement

What does this PR do / why do we need it:

This PR is proposed to add the support of TinyMS model loading and publishing functions.

Model load

For those who are new to TinyMS project, they can leverage tinyms.hub to easily load pretrained model and apply model evaluation and inference operation. Take LeNet5 model for example:

from PIL import Image
from tinyms import hub
from tinyms.vision import mnist_transform
from tinyms.model import Model

img = Image.open(img_path)
img = mnist_transform(img)

# load LeNet5 pretrained model
net= hub.load('tinyms/0.2/lenet5_v1_mnist', class_num=10)
model = Model(net)

res = model.predict(ts.expand_dims(ts.array(img), 0)).asnumpy()
print("The label is:", mnist_transform.postprocess(res))

Model support

Currently we add five model assets into TinyMS Hub:

  • tinyms/0.2/lenet5_v1_mnist
  • tinyms/0.2/resnet50_v1_cifar10
  • tinyms/0.2/resnet50_v1_mushroom
  • tinyms/0.2/mobilenet_v2_cifar10
  • tinyms/0.2/ssd300_v1_voc2007

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewers:

@leonwanghui leonwanghui self-assigned this May 13, 2021
Signed-off-by: leonwanghui <wanghui71leon@gmail.com>
@leonwanghui leonwanghui merged commit 1d45bca into tinyms-ai:main May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants