运行预转换的神经网络

To run a image classification neural network on a random image using an evaluation kit:
要使用评估套件对随机图像运行图像分类神经网络,请执行以下操作:

  1. Install a pre-built image and connect to the board as described here
    安装一个预构建的镜像并连接到主板,如 这里 所述。

  2. On the target first go to the model directory:
    在目标环境中,首先进入model目录:

    $ cd /usr/share/synap/models/image_classification/imagenet/model/mobilenet_v2_1.0_224_quant/
    
  3. Then test the model inference time using random inputs:
    然后使用随机输入,测试模型推理时间:

    $ synap_cli random
    Flush/invalidate: yes
    Loop period (ms): 0
    Network inputs: 1
    Network outputs: 1
    Input buffer: input size: 150528 : random
    Output buffer: output size: 1001
    
    Predict #0: 12.61 ms
    
    Inference timings (ms):  load: 28.37  init: 66.99  min: 12.60  median: 12.60  max: 12.60  stddev: 0.00  mean: 12.60
    
  4. Then test the model accuracy with a sample image:
    然后使用样本图像,测试模型精度:

    $ synap_cli_ic ../../sample/goldfish_224x224.jpg
    
    Loading network: model.nb
    Input image: ../../sample/goldfish_224x224.jpg
    Classification time: 3.15 ms (pre:0.56, inf:2.53, post:0.05)
    Class  Confidence  Description
        1     18.9874  goldfish, Carassius auratus
      112      9.2959  conch
      927      8.7025  trifle
       29      8.2081  axolotl, mud puppy, Ambystoma mexicanum
      122      7.7136  American lobster, Northern lobster, Maine lobster, Homarus americanus
    

To learn about other ai demos refer to Machine Learning with SyNAP.
要了解其他AI演示, 请参阅 使用SyNAP进行机器学习