Skip to content

v0.2.0

Compare
Choose a tag to compare
@leonwanghui leonwanghui released this 07 Jun 01:35
· 49 commits to main since this release

Released 2021-06-07.

Major Features and Improvements

  • Add text module to provide the basic dataset loading and preprocessing in NLP scenarios. #53 #73
  • Upgrade the version of mindspore module dependencies from v1.1.1 to v1.2.0. #81 #84
  • Refactor the Client and Server communication interface in serving module. #76
  • Added server_path, start FlaskServer and add host and port parameters. #77
  • Implement TinyMS hub module to enable loading lots of pre-trained models, incluidng lenet5_v1, resnet50_v1, alexnet_v1, vgg16_v1, mobilenet_v2 and ssd300_v1. #86 #93
  • Publish the TinyMS Hub contributing guidelines in public to welcome pre-trained model from the comunity. #91
  • Refactor the model network entrypoint method to provide the unified interface. #85

Model Park

  • Add 5 models support: AlexNet, DenseNet100, VGG16, SentimentNet, Bert. #59 #89 #63 #67

API Change

  • Refactor the serving entrypoint function with Client and Server class interface.
v0.1.0 v0.2.0
from tinyms.serving import start_server, server_started, list_servables, predict, shutdown

start_server()
if server_started():
    list_servables()
    predict('example.jpg', 'servable_name', dataset_name='mnist')
shutdown()
from tinyms.serving import Client, Server

server = Server()
server.start_server()
client = Client()
client.list_servables()
client.predict('example.jpg', 'servable_name', dataset_name='mnist')
server.shutdown()
  • Add a new interface load in model module to support load MindIR graph directly to perform model inference operation.
v0.2.0
>>> import tinyms as ts
>>> import tinyms.layers as layers
>>> from tinyms.model import Model, load
>>>
>>> net = layers.Conv2d(1, 1, kernel_size=3)
>>> model = Model(net)
>>> input = ts.ones([1, 1, 3, 3])
>>> model.export(input, "net", file_format="MINDIR")
...
>>> net = load("net.mindir")
>>> print(net(input))
[[[[ 0.02548009  0.04010789  0.03120251]
    [ 0.00268656  0.02353744  0.03807815]
    [-0.00896441 -0.00303641  0.01502199]]]]
  • Add hub.load method to easily load pretrained model and apply model evaluation and inference operation.
v0.2.0
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))

For the detailed API changes, please find TinyMS Python API in API Documentation.

Backwards Incompatible Change

None

Bug fixes

  • Fix some bugs when serving in Windows operating system. #74
  • Set batch_norm as True by default in VGG16 to fix the converge problem of accuracy. #90

Contributors

Great thanks go to these wonderful people:

@zjuter0126, @Mickls, @leonwanghui, @hannibalhuang, @hellowaywewe, @huxiaoman7