|
|
|
@ -18,7 +18,7 @@ def set_input_tensor(interpreter, image):
|
|
|
|
|
input_tensor = interpreter.tensor(tensor_index)()[0] |
|
|
|
|
input_tensor[:, :] = image |
|
|
|
|
|
|
|
|
|
def classify_image(interpreter, image): |
|
|
|
|
def classify_image(interpreter, image, top_k=1): |
|
|
|
|
"""Returns a sorted array of classification results.""" |
|
|
|
|
set_input_tensor(interpreter, image) |
|
|
|
|
interpreter.invoke() |
|
|
|
|