导航

    • 登录
    • 搜索
    • 版块
    • 产品
    • 教程
    • 论坛
    • 淘宝
    1. 主页
    2. wuhc
    W
    • 举报资料
    • 资料
    • 关注
    • 粉丝
    • 屏蔽
    • 帖子
    • 楼层
    • 最佳
    • 群组

    wuhc

    @wuhc

    0
    声望
    5
    楼层
    375
    资料浏览
    0
    粉丝
    0
    关注
    注册时间 最后登录

    wuhc 关注

    wuhc 发布的帖子

    • 这是做完训练运行后出的问题,这是为啥?

      0_1636110556827_52893311111e5e69c3bb159e1131996.png

      发布在 OpenMV Cam
      W
      wuhc
    • RE: 在训练模型的时候图片保存正确了,路径也对,能帮忙看一下吗?

      放到内存卡上,别用芯片的

      发布在 OpenMV Cam
      W
      wuhc
    • RE: 神经网络训练(EDGE IMPULSE)的压缩包打开一直错误(但看文件好像可以用)然后用里面的模型时,一运行就断开连接

      但是我这个就可以运行啊

      #导入功能包
      import pyb
      import sensor, image, time, math
      import os, tf
      
      #摄像头传感器配置
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA) # we run out of memory if the resolution is much bigger...
      sensor.set_brightness(500)
      sensor.skip_frames(time = 20)
      sensor.set_auto_gain(True)  # must turn this off to prevent image washout...
      sensor.set_auto_whitebal(True,(0,0x80,0))  # must turn this off to prevent image washout...
      clock = time.clock()
      
      #导入模型
      net_path = "mnist_acc_0.9921_quant.tflite"                                  # 定义模型的路径
      labels = ["0", "1", "2", "3","4","5", "6", "7", "8", "9"]   # 加载标签
      net = tf.load(net_path, load_to_fb=True)                                  # 加载模型
      
      
      while(True):
          #拍摄一张照片
          img = sensor.snapshot()
          #寻找矩形
          for r in img.find_rects(threshold = 50000):
              #矩形画框
              img.draw_rectangle(r.rect(), color = (255, 0, 0))
              #提取矩形中图像
              img1 = img.copy(r.rect())
              #运行模型识别
              for obj in tf.classify(net , img1, min_scale=1.0, scale_mul=0.5, x_overlap=0.0, y_overlap=0.0):
                  #计算结果
                  sorted_list = sorted(zip(labels, obj.output()), key = lambda x: x[1], reverse = True)
                  #在图像中画出结果
                  img.draw_string(r.rect()[0] + 20, r.rect()[1]-20, sorted_list[0][0],color = (255,0,0), scale = 2,mono_space=False)
      
      
      发布在 OpenMV Cam
      W
      wuhc
    • RE: 神经网络训练(EDGE IMPULSE)的压缩包打开一直错误(但看文件好像可以用)然后用里面的模型时,一运行就断开连接

      openmv-H7 R1

      发布在 OpenMV Cam
      W
      wuhc
    • 神经网络训练(EDGE IMPULSE)的压缩包打开一直错误(但看文件好像可以用)然后用里面的模型时,一运行就断开连接
      # Edge Impulse - OpenMV Image Classification Example
      
      import sensor, image, time, os, tf
      
      sensor.reset()                         # Reset and initialize the sensor.
      sensor.set_pixformat(sensor.GRAYSCALE)    # Set pixel format to RGB565 (or GRAYSCALE)
      sensor.set_framesize(sensor.QVGA)      # Set frame size to QVGA (320x240)
      sensor.set_windowing((240, 240))       # Set 240x240 window.
      sensor.skip_frames(time=2000)          # Let the camera adjust.
      
      net = "trained.tflite"
      labels = ["3","8"]
      
      clock = time.clock()
      while(True):
          clock.tick()
      
          img = sensor.snapshot()
      
          # default settings just do one detection... change them to search the image...
          for obj in tf.classify(net, img, min_scale=1.0, scale_mul=0.8, x_overlap=0.5, y_overlap=0.5):
              print("**********\nPredictions at [x=%d,y=%d,w=%d,h=%d]" % obj.rect())
              img.draw_rectangle(obj.rect())
              # This combines the labels and confidence values into a list of tuples
              predictions_list = list(zip(labels, obj.output()))
      
              for i in range(len(predictions_list)):
                  print("%s = %f" % (predictions_list[i][0], predictions_list[i][1]))
      
          print(clock.fps(), "fps")
      
      

      0_1636106239721_94e13821f4a9bf75673b523d0190568.png

      发布在 OpenMV Cam
      W
      wuhc