链接:https://pan.baidu.com/s/1I9N3lRe_t9C24IKJRcv89Q?pwd=1212
由于OpenCVSharp缺少相关api,这次使用EmguCv,这个demo网上都是python版本的,抄写为C#
使用ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt和frozen_inference_graph.pb模型
public class EasyObjectDetection
{
public static void Run()
{
string modelPathBase = @"D:\SourceCode\Models\";
string classesfile = modelPathBase + "coco.names";
string configPath = modelPathBase + "ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt";
string weightsPath = modelPathBase + "frozen_inference_graph.pb";
var thres = 0.5f;
var cap = new VideoCapture(modelPathBase + "Road_traffic_video2.mp4");
string[] classes = File.ReadAllLines(classesfile);

该代码示例展示了如何在C#中使用EmguCv库,基于SSD_MobileNet_V3模型和预训练权重进行对象检测。程序读取视频文件,应用模型进行检测,并在检测到的物体周围画出矩形框。模型配置文件、权重文件和类别文件都是必要的输入。
最低0.47元/天 解锁文章
440

被折叠的 条评论
为什么被折叠?



