导航

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

    xlag

    @xlag

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

    xlag 关注

    xlag 发布的帖子

    • 使用tflite识别数字,我要让识别度最高的数字识别出来要怎么改代码?

      0_1627789532636_1.png

      # Edge Impulse - OpenMV Image Classification Example
      
      只让这个识别度最高的1输出出来,要怎么改
      
      import sensor, image, time, os, tf
      
      sensor.reset()                         # Reset and initialize the sensor.
      sensor.set_pixformat(sensor.RGB565)    # 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 = [line.rstrip('\n') for line in open("labels.txt")]
      
      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]))
      
      发布在 OpenMV Cam
      X
      xlag
    • lmportError: no module named 'nn'没有神经网络nn的数据包

      在做数字识别例程,但是内有这个包怎么解决

      0_1627440656148_90ea9e57-d453-46f2-8687-a06368d89424-image.png

      发布在 OpenMV Cam
      X
      xlag
    • 硬件问题,wifi模块老是接触不良,导致有时候不能初始化?

      wifi模块老是接触不良,导致有时候不能初始化,然后断掉链接,怎么整,我已经插很紧了。还是会这样

      发布在 OpenMV Cam
      X
      xlag
    • RE: 人脸识别加wifi模块,网站上看不到框,ide上面可以?

      @kidswong999 谢谢

      发布在 OpenMV Cam
      X
      xlag
    • OSError: Failed to initialize WINC1500 module: Init failed!?

      用wifi模块有时候会报错,但是有时候就可以运行
      0_1616591769013_97b517e5-932b-4c91-bcb1-e28c907675f3-image.png

      发布在 OpenMV Cam
      X
      xlag
    • 人脸识别加wifi模块,网站上看不到框,ide上面可以?
      # MJPEG Streaming AP.
      #
      # 这个例子展示了如何在AccessPoint模式下进行MJPEG流式传输。
      # Android上的Chrome,Firefox和MJpegViewer App已经过测试。
      # 连接到OPENMV_AP并使用此URL:http://192.168.1.1:8080查看流。
      
      import sensor, image, time, network, usocket, sys
      
      SSID ='OPENMV_AP'    # Network SSID
      KEY  ='1234567890'   # wifi密码(必须为10字符)
      HOST = ''           # 使用第一个可用的端口
      PORT = 8080         # 任意非特权端口
      
      # 重置传感器
      sensor.reset()
      # 设置传感器设置
      sensor.set_contrast(3)
      sensor.set_brightness(1)
      sensor.set_saturation(1)
      sensor.set_gainceiling(16)
      sensor.set_framesize(sensor.QQVGA)
      sensor.set_pixformat(sensor.GRAYSCALE)
      
      face_cascade = image.HaarCascade("frontalface", stages=25)
      
      # 在AP模式下启动wlan模块。
      wlan = network.WINC(mode=network.WINC.MODE_AP)
      wlan.start_ap(SSID, key=KEY, security=wlan.WEP, channel=2)
      
      #您可以阻止等待客户端连接
      #print(wlan.wait_for_sta(10000))
      
      def start_streaming(s):
          print ('Waiting for connections..')
          client, addr = s.accept()
          # 将客户端套接字超时设置为2秒
          client.settimeout(2.0)
          print ('Connected to ' + addr[0] + ':' + str(addr[1]))
      
          # 从客户端读取请求
          data = client.recv(1024)
          # 应该在这里解析客户端请求
      
          # 发送多部分head
          client.send("HTTP/1.1 200 OK\r\n" \
                      "Server: OpenMV\r\n" \
                      "Content-Type: multipart/x-mixed-replace;boundary=openmv\r\n" \
                      "Cache-Control: no-cache\r\n" \
                      "Pragma: no-cache\r\n\r\n")
      
          # FPS clock
          clock = time.clock()
      
          # 开始流媒体图像
          #注:禁用IDE预览以增加流式FPS。
          while (True):
              
              img = sensor.snapshot()
      
              clock.tick() # 跟踪snapshots()之间经过的毫秒数。
              frame = sensor.snapshot()
              cframe = frame.compressed(quality=35)
              header = "\r\n--openmv\r\n" \
                       "Content-Type: image/jpeg\r\n"\
                       "Content-Length:"+str(cframe.size())+"\r\n\r\n"
      
              objects = img.find_features(face_cascade, threshold=0.75, scale=1.35)
              for r in objects:
                     img.draw_rectangle(r)
      
      
              client.send(header)
              client.send(cframe)
              print(clock.fps())
      
      while (True):
          # 创建服务器套接字
          s = usocket.socket(usocket.AF_INET, usocket.SOCK_STREAM)
          try:
              # Bind and listen
              s.bind([HOST, PORT])
              s.listen(5)
      
              # 设置服务器套接字超时
              # 注意:由于WINC FW bug,如果客户端断开连接,服务器套接字必须
              # 关闭并重新打开。在这里使用超时关闭并重新创建套接字。
              s.settimeout(3)
              start_streaming(s)
          except OSError as e:
              s.close()
              print("socket error: ", e)
              #sys.print_exception(e)
      
      
      发布在 OpenMV Cam
      X
      xlag