6. 自定义模型功能-图像分类

6.1. 代码

例程:

from mpython import *
from camera import *
import time

camera = CameraV831(tx=Pin.P16, rx=Pin.P15)
camera.model_restnet18_init(["label1","label2","label3"],'/root/model/resnet18_1000_awnn.param','/root/model/resnet18_1000_awnn.bin',224,224)
while True:
    camera.restnet18_model.recognize()
    print(camera.restnet18_model.id)
    time.sleep_ms(10)

6.2. mPython图形化示例

../_images/2.png