【问题标题】:Integrate yolo custom object detector in flutter app is not detecting any object在flutter app中集成yolo自定义对象检测器未检测到任何对象
【发布时间】:2021-10-23 05:12:59
【问题描述】:

我正在准备集成我的自定义 YOLO 模型(我尝试使用 YOLOv3 和 YOLOv4)以像 https://stackoverflow.com/a/62990869/9420938 中显示的那样颤动。但是,当我调用 Tflite.detectObjectOnFrame() 时,模型总是返回一个空数组。如果我调用 Tflite.runModelOnFrame() 它返回对象的标签,但不返回边界框。有人知道会发生什么吗?

    Tflite.loadModel(
          model: "assets/yolov3-tiny-416.tflite",
          labels: "assets/labels.txt",
          numThreads: 1, // defaults to 1
          isAsset: true, // defaults to true, set to false to load resources outside assets
          useGpuDelegate: false // defaults to false, set to true to use GPU delegate
        ).then((res){
          _initialized = res;
        });

var recognitions = await Tflite.detectObjectOnFrame(
          model: "YOLOv3",
          bytesList: image.planes.map((plane) {return plane.bytes;}).toList(),// required
          imageHeight: image.height,
          imageWidth: image.width,
          imageMean: 0,   
          imageStd: 255.0,     
          numResultsPerClass: 2,
          numBoxesPerBlock: 5, 
          threshold: 0.3,     
          blockSize: 32,       
          asynch: true        
        );

【问题讨论】:

    标签: flutter object-detection tensorflow-lite yolo yolov4


    【解决方案1】:

    确保您将 tflite_flutter_plugin 与 tflite_flutter_helper 一起使用: https://pub.dev/packages/tflite_flutter

    而不是 tflite(目前仅支持 yolov2): https://pub.dev/packages/tflite

    编辑: 为了让 Yolo 高于 v2 在 tflite_flutter_plugin 中工作,您应该遵循以下说明: https://github.com/TexMexMax/object_detection_flutter

    注意:在编辑 tflite_flutter_helper 插件时,请确保删除其中的示例,因为这会导致错误并使您的应用崩溃(这就是发生在我身上的事情)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-10-17
      • 2018-07-26
      • 2022-01-20
      • 2020-12-12
      • 2018-04-24
      • 2019-01-13
      • 1970-01-01
      • 2018-01-17
      相关资源
      最近更新 更多