Running image classification in Python with a NatML Hub predictor.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fetch the model data from Hub | |
model_data = MLModelData.from_hub("@natsuite/resnet152", access_key); | |
# Deserialize the model # The model is actually being created server-side | |
model = model_data.deserialize(); | |
# Create the ResNet classification Hub predictor | |
predictor = ResNetHubPredictor(model); | |
# Predict | |
image = PIL.Image.open(...); | |
label, score = predictor.Predict(image); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment