是否可以将图像从C#发送到yolo并接收所有检测到的对象位置和类型。

例如在演示图像上

type      | x   | y   | width | height
-------------------------------------------
bicycle   | 214 | 150 | 450   | 378
dog       | 150 | 260 | 210   | 350
truck     | 540 | 100 | 250   | 150


c# - 将图像发送到yolo(暗网)并接收对象的位置和类型-LMLPHP

范例程式码

public class Yolo
{
    public ObjectPosition[] GetObjects(Image image)
    {
        //return yolo result
    }
}

public class ObjectPosition
{
    public string Type { get; set; }
    public int X { get; set; }
    public int Y { get; set; }
    public int Width { get; set; }
    public int Height { get; set; }
}

最佳答案

是的,您可以根据需要使用此nuget软件包Alturos.Yolo。您在product page上找到的更多信息。

安装依赖

首先安装这两个nuget软件包,第一个是opencv和c ++ yolo项目的逻辑,第二个包含yolo配置数据。

PM> install-package Alturos.Yolo
PM> install-package Alturos.YoloV2TinyVocData


代码示例

using (var yoloWrapper = new YoloWrapper("yolov2-tiny-voc.cfg", "yolov2-tiny-voc.weights", "voc.names"))
{
    var items = yoloWrapper.Detect("image.jpg");
}

09-12 10:44
查看更多