grubguesser-django / src /predict.py
Jon Solow
Copy setup from yahoo-ff-dev and grubguesser-api
8e681e8
raw
history blame
246 Bytes
from model import CNN, LABELS
def predict_model(img_array):
class_prob = CNN.predict(img_array)
top_values_index = (-class_prob).argsort()[0][:10]
top_guesses = [LABELS[i].title() for i in top_values_index]
return top_guesses