Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Daniel Heinze - Expose your machine learning mo...

Daniel Heinze - Expose your machine learning model through Flask and Docker

As building Machine Learning models becomes easier through tools like sklearn, the deployment and customization of the whole ML process remains a difficult to solve task. In this talk I present a simple solution to publish an Object Classification model through the Python framework Flask and demonstrate how to supply your model to others with Docker and Azure.

PyConWeb

July 17, 2018
Tweet

More Decks by PyConWeb

Other Decks in Programming

Transcript

  1. Classification – Using a model KNeighborsClassifier(algorithm='auto’, leaf_size=30, metric='minkowski', metric_params=None, n_jobs=1,

    n_neighbors=3, p=2, weights='uniform') By Antti Ajanki AnAj - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=2170282
  2. CNN – Max Pooling • Reduce dimensionality (Speed up the

    network) • More tolerant to object location changes
  3. pred_label = model.predict(arr.flatten()) pred_prob = model.predict_proba(arr.flatten()) index = np.where(model.classes_ ==

    pred_label) return ( pred_label[0], pred_prob[0][index][0] ) predictions = model.eval(arr)[0] top_class = np.argmax(predictions) lables = ['croissant', 'sloth’] return ( lables[top_class], predictions[top_class] )
  4. aka.ms/dheinze for info || aka.ms/dheinze-py for script { "About me":

    { "Name": "Daniel Heinze", "Mail": "[email protected]", "Description": "Software Developer since 2006", "Twitter": "@starlord_daniel", "Facebook": "danielsdevblog", "Github": "https://github.com/starlord-daniel" } }