Added top_k
This commit is contained in:
parent
25190c64e2
commit
0bed68679a
@ -18,7 +18,7 @@ def set_input_tensor(interpreter, image):
|
|||||||
input_tensor = interpreter.tensor(tensor_index)()[0]
|
input_tensor = interpreter.tensor(tensor_index)()[0]
|
||||||
input_tensor[:, :] = image
|
input_tensor[:, :] = image
|
||||||
|
|
||||||
def classify_image(interpreter, image):
|
def classify_image(interpreter, image, top_k=1):
|
||||||
"""Returns a sorted array of classification results."""
|
"""Returns a sorted array of classification results."""
|
||||||
set_input_tensor(interpreter, image)
|
set_input_tensor(interpreter, image)
|
||||||
interpreter.invoke()
|
interpreter.invoke()
|
||||||
|
Loading…
Reference in New Issue
Block a user