










from maix import nn, camera, display, image
from classes_label import labels
model_path = "mode_resnet18_1000_classes.mud"
camera.config(size=(224, 224))
m = nn.load(model_path)
while True:
img = camera.capture()
out = m.forward(img)
out = nn.F.softmax(out)
msg = "{:.2f}: {}".format(out.max(), labels[out.argmax()])
img = img.draw_string(2, 2, msg, color=(255, 0, 0))
display.show(img)










