|
|
分享一个组合用法:先用Yolo.Detect粗定位目标区域,再用Classify对该区域做精细分类,兼顾速度和准确率。
- let boxes = Yolo.Detect(img, {model: "detector"})
- for (let b of boxes) {
- let crop = Screen.CaptureBase64({left: b.x, top: b.y, width: b.w, height: b.h})
- let cls = Classify.Predict(crop, {model: "classifier"})
- print(b, cls.label)
- }
复制代码
这种"检测+分类"两阶段的做法在目标种类比较多、单独训练一个大模型成本高的场景下很好用。 |
|