当前位置: 首页 > news >正文

【git-hub项目:YOLOs-CPP】本地实现03:跑自己的实例分割模型

本节博客,我们继续讲解,如何在cpu+windows上,跑通自己的实例分割模型。

目录

模型

类别名称

量化

导出模型

拉取最新代码

进入官网ultralytics



模型

该项目包括存储在 modelsquantized_models 目录中的各种预训练标准 YOLO 模型:

模型类型模型名称
标准模型yolo5-n6.onnx
yolo7-tiny.onnx
yolo8n.onnx
yolo8n-seg.onnx
yolo10n.onnx
yolo11n.onnx
yolo11n-seg.onnx
量化模型yolo5-n6_uint8.onnx
yolo7-tiny-uint8.onnx
yolo8n_uint8.onnx
yolo8n-seg_uint8.onnx
yolo10n_uint8.onnx
yolo11n_uint8.onnx
yolo11n-seg_uint8.onnx

你也可以使用带有自定义类别的自定义 YOLO 版本!

比如,我们用ultralytics训练好的实例分割模型best.pt,我们再用原生的ultralytics转onnx方式,转为best.onnx。如下:

类别名称

  • coco.names:包含模型所使用的类别标签列表。

这里,我们也要修改coco.names,改为自己的标签!

量化

quantized_models 目录中包含针对低精度推理优化的 YOLO 模型的量化版本。此外,quantized_models/yolos_quantization.py 脚本可用于对自定义 YOLO 模型进行自定义量化。

注意:量化模型具有模型体积更小的优势,并且在准确性略有下降的情况下,可能实现更快的推理速度。

我们先不量化试一下:

修改源码:

然后,点击重新生成!

并且,运行exe,但是,你会发现,没有出结果。

怎么办呢?我们查看项目源码,发现,后来支持了seg:

但是,源码还是det【目标检测】。

因此,我们将源码从原始代码:

/*** @file image_inference.cpp* @brief Object detection in a static image using YOLO models (v5, v7, v8, v10).* * This file implements an object detection application that utilizes YOLO * (You Only Look Once) models, specifically versions 5, 7, 8, and 10. * The application loads a specified image, processes it to detect objects, * and displays the results with bounding boxes around detected objects.** The application supports the following functionality:* - Loading a specified image from disk.* - Initializing the YOLO detector with the desired model and labels.* - Detecting objects within the image.* - Drawing bounding boxes around detected objects and displaying the result.** Configuration parameters can be adjusted to suit specific requirements:* - `isGPU`: Set to true to enable GPU processing for improved performance; *   set to false for CPU processing.* - `labelsPath`: Path to the class labels file (e.g., COCO dataset
http://www.lryc.cn/news/537198.html

相关文章:

  • MySQL和SQL server的区别
  • C#运动控制——轴IO映射
  • DeepSeek官方发布R1模型推荐设置
  • DeepSeek教unity------MessagePack-03
  • 《安富莱嵌入式周报》第350期:Google开源Pebble智能手表,开源模块化机器人平台,开源万用表,支持10GHz HRTIM的单片机,开源CNC控制器
  • img标签的title和alt
  • MambaMorph brain MR-CT
  • 小米 R3G 路由器(Pandavan)实现网络打印机功能
  • Python PyCharm DeepSeek接入
  • 【ISO 14229-1:2023 UDS诊断全量测试用例清单系列:第二十节】
  • jemalloc 5.3.0的base模块的源码及调用链使用场景的详细分析
  • ThreadLocal源码分析
  • Python爬虫实战:获取笔趣阁图书信息,并做数据分析
  • 如何在Java EE中使用标签库?
  • 3天功能开发→3小时:通义灵码2.0+DEEPSEEK实测报告,单元测试生成准确率92%的秘密
  • STM32 Flash详解教程文章
  • ubuntu服务器部署
  • 小爱音箱控制手机和电视听歌的尝试
  • 问卷数据分析|SPSS实操之独立样本T检验
  • Linux 内核 IPoIB 驱动中 sysfs 属性冲突问题的分析与解决
  • 双ESP8266-01S通讯UDP配置
  • 【C】初阶数据结构5 -- 栈
  • 闭源大语言模型的怎么增强:提示工程 检索增强生成 智能体
  • C语言-------结构体(1)
  • org.apache.kafka.common.errors.TimeoutException
  • Ceph集群搭建2025(squid版)
  • DeepSeek从入门到精通:提示词设计的系统化指南
  • python后端调用Deep Seek API
  • 自有证书的rancher集群使用rke部署k8s集群异常
  • 【线性代数】1行列式