【问题标题】:is there is way to use custom model in ml5 yolo()?有没有办法在 ml5 yolo() 中使用自定义模型?
【发布时间】:2019-08-17 23:58:17
【问题描述】:

因为 ml5 yolo() 提到

“这个实现很大程度上来源于 ModelDepot”。

它没有提到它正在使用哪个预训练模型,或者你如何使用自己的训练模型

let video;
let yolo;
let status;
let objects = [];

function setup() {
  createCanvas(320, 240);
  video = createCapture(VIDEO);
  video.size(320, 240);

  // Create a YOLO method
  yolo = ml5.YOLO(video, startDetecting);

  // Hide the original video
  video.hide();
  status = select('#status');
}

function draw() {
  image(video, 0, 0, width, height);
  for (let i = 0; i < objects.length; i++) {
    noStroke();
    fill(0, 255, 0);
    text(objects[i].className, objects[i].x * width, objects[i].y * height - 5);
    noFill();
    strokeWeight(4);
    stroke(0, 255, 0);
    rect(objects[i].x * width, objects[i].y * height, objects[i].w * width, objects[i].h * height);
  }
}

function startDetecting() {
  status.html('Model loaded!');
  detect();
}

function detect() {
  yolo.detect(function(err, results) {
    objects = results;
    detect();
  });
}

【问题讨论】:

  • 感谢您分享您的代码和问题。你能具体说明你的问题吗?
  • @Archie 我刚回来遇到了 ml5,我发现它很容易使用,所以我决定按照那里的文档使用 yolo,它工作正常。但我想使用我自己训练有素的模型。例如,它没有检测到魔方,我想使用我自己的训练模型,知道什么是魔方。换句话说,我只想使用其他一些预训练模型
  • 由于某种情况,我不得不用javascript制作yolo模型,我对python不太熟悉
  • 来自我的消息来源,他们没有在文档中提及,但我认为他们正在使用 github.com/ml5js/ml5-data-and-models/tree/master/models/YOLO 这个预训练模型

标签: machine-learning computer-vision object-detection tensorflow.js yolo


【解决方案1】:

我一直在阅读 yolo 文档,我找到了一种方法:

ml5-yolo-library -> 大量源自https://github.com/ModelDepot/tfjs-yolo-tiny (ModelDepot: modeldepot.io)

这里->https://modeldepot.io/mikeshi/tiny-yolo-in-javascript

说 -> 这个模型是从原始的 Darknet Tiny YOLO cfg 和权重创建的,通过 YAD2K 将其转换为 Keras,然后使用 tensorflowjs_converter 将其转换为 Tensorflow.js 格式。

所以,我现在正在尝试做和你一样的事情。希望我能找到方法

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-01-26
    • 2012-07-31
    • 2011-02-08
    • 2021-07-26
    • 2019-11-28
    • 1970-01-01
    • 2021-11-24
    • 1970-01-01
    相关资源
    最近更新 更多