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

药品名字检测和识别3:基于深度学习YOLO26神经网络实现药品名字检测和识别(含训练代码、数据集和GUI交互界面)

基于深度学习YOLO26神经网络实现药品名字检测和识别,其能识别检测出1种药品名字检测:names = {0:'drug-name'}

具体图片见如下:

第一步:YOLO26介绍

YOLO26采用了端到端无NMS推理,直接生成预测结果,无需非极大值抑制(NMS)后处理。这种设计减少了延迟,简化了集成,并提高了部署效率。此外,YOLO26移除了分布焦点损失(DFL),从而增强了硬件兼容性,特别是在边缘设备上的表现。

模型还引入了ProgLoss小目标感知标签分配(STAL),显著提升了小目标检测的精度。这对于物联网、机器人技术和航空影像等应用至关重要。同时,YOLO26采用了全新的MuSGD优化器,结合了SGD和Muon优化技术,提供更稳定的训练和更快的收敛速度。

第二步:YOLO26网络结构

第三步:代码展示

# Ultralytics YOLO 🚀, AGPL-3.0 license from pathlib import Path from ultralytics.engine.model import Model from ultralytics.models import yolo from ultralytics.nn.tasks import ClassificationModel, DetectionModel, OBBModel, PoseModel, SegmentationModel, WorldModel from ultralytics.utils import ROOT, yaml_load class YOLO(Model): """YOLO (You Only Look Once) object detection model.""" def __init__(self, model="yolo11n.pt", task=None, verbose=False): """Initialize YOLO model, switching to YOLOWorld if model filename contains '-world'.""" path = Path(model) if "-world" in path.stem and path.suffix in {".pt", ".yaml", ".yml"}: # if YOLOWorld PyTorch model new_instance = YOLOWorld(path, verbose=verbose) self.__class__ = type(new_instance) self.__dict__ = new_instance.__dict__ else: # Continue with default YOLO initialization super().__init__(model=model, task=task, verbose=verbose) @property def task_map(self): """Map head to model, trainer, validator, and predictor classes.""" return { "classify": { "model": ClassificationModel, "trainer": yolo.classify.ClassificationTrainer, "validator": yolo.classify.ClassificationValidator, "predictor": yolo.classify.ClassificationPredictor, }, "detect": { "model": DetectionModel, "trainer": yolo.detect.DetectionTrainer, "validator": yolo.detect.DetectionValidator, "predictor": yolo.detect.DetectionPredictor, }, "segment": { "model": SegmentationModel, "trainer": yolo.segment.SegmentationTrainer, "validator": yolo.segment.SegmentationValidator, "predictor": yolo.segment.SegmentationPredictor, }, "pose": { "model": PoseModel, "trainer": yolo.pose.PoseTrainer, "validator": yolo.pose.PoseValidator, "predictor": yolo.pose.PosePredictor, }, "obb": { "model": OBBModel, "trainer": yolo.obb.OBBTrainer, "validator": yolo.obb.OBBValidator, "predictor": yolo.obb.OBBPredictor, }, } class YOLOWorld(Model): """YOLO-World object detection model.""" def __init__(self, model="yolov8s-world.pt", verbose=False) -> None: """ Initialize YOLOv8-World model with a pre-trained model file. Loads a YOLOv8-World model for object detection. If no custom class names are provided, it assigns default COCO class names. Args: model (str | Path): Path to the pre-trained model file. Supports *.pt and *.yaml formats. verbose (bool): If True, prints additional information during initialization. """ super().__init__(model=model, task="detect", verbose=verbose) # Assign default COCO class names when there are no custom names if not hasattr(self.model, "names"): self.model.names = yaml_load(ROOT / "cfg/datasets/coco8.yaml").get("names") @property def task_map(self): """Map head to model, validator, and predictor classes.""" return { "detect": { "model": WorldModel, "validator": yolo.detect.DetectionValidator, "predictor": yolo.detect.DetectionPredictor, "trainer": yolo.world.WorldTrainer, } } def set_classes(self, classes): """ Set classes. Args: classes (List(str)): A list of categories i.e. ["person"]. """ self.model.set_classes(classes) # Remove background if it's given background = " " if background in classes: classes.remove(background) self.model.names = classes # Reset method class names # self.predictor = None # reset predictor otherwise old names remain if self.predictor: self.predictor.model.names = classes

第四步:统计训练过程的一些指标,相关指标都有

第五步:运行(支持图片、文件夹、摄像头和视频功能)

第六步:整个工程的内容

有训练代码和训练好的模型以及训练过程,提供数据,提供GUI界面代码

项目完整文件下载请见演示与介绍视频的简介处给出:➷➷➷

https://www.bilibili.com/video/BV1ChNs6dExE/

http://www.cnnetsun.cn/news/3310486.html

相关文章:

  • Seedance 2.0 AI视频生成教程:多模态控制与1700+提示词实战
  • TDA7468音频处理器与PIC18F2682微控制器的音频路由系统设计
  • Godot引擎全流程进阶指南:从节点化设计到跨平台发布
  • 三步掌握猫抓浏览器扩展:专业级网页资源嗅探与下载方案
  • jQuery 通用数字增减输入框组件(多实例复用、纯数字校验、最小值限制)
  • WPA3 与 WPA2 无线加密深度对比:AES-256 vs TKIP 的 5 项关键安全指标实测
  • Cursor AI智能提示配置深度拆解(隐藏参数+上下文权重调优大揭秘)
  • MCP3428与PIC32MX675F256L高精度数据采集系统设计
  • Gemini Enterprise智能体平台:企业级AI应用落地实战指南
  • C++ vector模拟实现:从三指针模型到迭代器失效的底层原理
  • UniDriveVLA:统一视觉-语言-动作表征的自动驾驶认知架构
  • IntelliJ IDEA 2024.3 配置 Android SDK 避坑指南:3个关键步骤解决环境依赖
  • AMD Ryzen终极调试指南:用SMUDebugTool解锁处理器全部潜能
  • 3种Modbus-RTU调试工具对比:Modbus Poll/Slave、串口助手、Python脚本实测
  • Quartus II 13.1 SignalTap II 调试实战:2K深度采样捕获复位信号异常时序
  • 嵌入式linux学习记录十五,uboot熟悉2
  • 3步掌握ncmdump:网易云NCM文件转换完全指南
  • 基于插件化架构的Unity游戏实时翻译系统:多引擎调度与内存优化技术深度解析
  • EulerCopilot witChainD Web权限系统设计:团队协作与角色管理指南
  • 结构化分析5大工具对比:DFD、DD、判定表、判定树、结构化英语应用场景解析
  • Visual Studio 2022 与 .NET 8 SDK 环境配置:解决跨版本项目迁移的 4 个关键步骤
  • Anaconda 2024.10 虚拟环境配置:3种源配置方案对比与10秒提速实测
  • openEuler社区官网架构解析:如何用VitePress构建现代化开源门户
  • Nodejsporter 核心功能解析:深入了解 -s、-R、-B 参数用法
  • VS Code 1.90 远程开发配置:Ubuntu 服务器 SSH 连接与 5 个必备插件
  • Maven 依赖作用域实战:provided 与 compile 在 Spring Boot 3.2 项目中的 5 个关键差异
  • C++ JSON库nlohmann/json:现代C++数据序列化与配置管理实战
  • 零基础转行AI:2个月掌握NLP自然语言处理实战指南
  • 俄语专业听力提升:从术语积累到实战训练全解析
  • 基于PIC18LF46K40与压电发声器的智能警报系统设计