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

网站建设业务渠道淘宝seo是什么

网站建设业务渠道,淘宝seo是什么,社群营销的十大步骤,北京好的做网站的公司哪家好PCB缺陷检测数据集(yolov5,v7,v8) 数据集总共有两个文件夹,一个是pcb整体标注,一个是pcb部分截图。 整体标注有6个分类,开路,短路等都已经标注,标注格式为xml,每个文件夹下有100多张…

PCB缺陷检测数据集(yolov5,v7,v8) 数据集总共有两个文件夹,一个是pcb整体标注,一个是pcb部分截图。 整体标注有6个分类,开路,短路等都已经标注,标注格式为xml,每个文件夹下有100多张的图片,可转yolo格式,跑过效果很好,北京大学PCB数据集。 第二个是第一个的部分和增强,共10688张图片,多篇pcb论文用的是这个数据集(共6类),训练集和检测集总共有10688张,看最后一张图。标注格式为txt,可直接yolov5,v7,v8检测。

项目概述

本数据集是一个专门用于印刷电路板(PCB)缺陷检测的数据集,包含两个主要部分:一个是整体标注的PCB图像,另一个是部分截图和增强后的图像。整体标注部分有6个分类,包括开路、短路等常见缺陷,并且已经使用XML格式进行了标注。第二个部分是对第一个部分的部分截图和增强处理,共有10688张图像,标注格式为YOLO格式(txt文件),可以直接用于YOLOv5、YOLOv7和YOLOv8模型的训练和检测。

数据集特点

  • 高质量标注:所有标注数据经过处理,确保了标注质量。
  • 多样化类别:涵盖六类常见的PCB缺陷。
  • 多用途:适用于多种目标检测任务,特别是涉及PCB缺陷检测的应用。
  • 易于使用:提供了详细的说明文档和预处理好的标注文件,方便用户快速上手。
  • 学术认可:多篇PCB相关论文使用了该数据集,具有较高的学术价值和实际应用价值。

数据集结构

PCB_Defect_Detection_Dataset/
├── full_boards/                         # 整体标注的PCB图像
│   ├── images/                          # 图像文件夹
│   │   ├── train/                       # 训练集图像
│   │   ├── val/                         # 验证集图像
│   │   └── test/                        # 测试集图像
│   ├── annotations/                     # 标注文件夹 (XML格式)
│   │   ├── train/                       # 训练集标注
│   │   ├── val/                         # 验证集标注
│   │   └── test/                        # 测试集标注
├── partial_and_augmented/               # 部分截图和增强后的图像
│   ├── images/                          # 图像文件夹
│   │   ├── train/                       # 训练集图像
│   │   ├── val/                         # 验证集图像
│   │   └── test/                        # 测试集图像
│   ├── labels/                          # 标注文件夹 (YOLO格式)
│   │   ├── train/                       # 训练集标注
│   │   ├── val/                         # 验证集标注
│   │   └── test/                        # 测试集标注
├── README.md                            # 项目说明文档
└── data.yaml                            # 数据集配置文件

数据集内容

  • 总数据量
    • 整体标注的PCB图像:每个文件夹下约100多张图像。
    • 部分截图和增强后的图像:共10688张图像。
  • 标注格式
    • 整体标注:XML格式。
    • 部分截图和增强:YOLO格式(txt文件)。
  • 标注对象:各类PCB缺陷的位置。
  • 类别及数量
类别名标注个数
开路 (Open Circuit)具体数量
短路 (Short Circuit)具体数量
缺失元件 (Missing Component)具体数量
错误元件 (Wrong Component)具体数量
裂纹 (Crack)具体数量
污染 (Contamination)具体数量
  • 总计
    • 图像总数:整体标注约600张,部分截图和增强10688张
    • 标注总数:具体数量根据实际情况而定
    • 总类别数 (nc):6类

使用说明

  1. 环境准备

    • 确保安装了Python及其相关库(如torchopencv-pythonmatplotlib等)。
    • 下载并解压数据集到本地目录。
    • 安装YOLOv5、YOLOv7或YOLOv8所需的依赖项:
       
      git clone https://github.com/ultralytics/yolov5
      cd yolov5
      pip install -r requirements.txt
  2. 加载数据集

    • 可以使用常见的编程语言(如Python)来加载和处理数据集。
    • 示例代码如下:
import os
import xml.etree.ElementTree as ET
import pandas as pd
from pathlib import Path
from yolov5.utils.datasets import LoadImages, LoadImagesAndLabels
from yolov5.models.experimental import attempt_load
from yolov5.utils.general import non_max_suppression, scale_coords
from yolov5.utils.torch_utils import select_device
import cv2
import numpy as np# 定义数据集路径
dataset_path = 'PCB_Defect_Detection_Dataset'# 加载整体标注的图像和标注
def load_full_boards(folder):images_folder = os.path.join(dataset_path, 'full_boards', 'images', folder)annotations_folder = os.path.join(dataset_path, 'full_boards', 'annotations', folder)dataset = []for image_file in os.listdir(images_folder):if image_file.endswith('.jpg') or image_file.endswith('.png'):image_path = os.path.join(images_folder, image_file)annotation_path = os.path.join(annotations_folder, image_file.replace('.jpg', '.xml').replace('.png', '.xml'))tree = ET.parse(annotation_path)root = tree.getroot()labels = []for obj in root.findall('object'):name = obj.find('name').textbndbox = obj.find('bndbox')xmin = int(bndbox.find('xmin').text)ymin = int(bndbox.find('ymin').text)xmax = int(bndbox.find('xmax').text)ymax = int(bndbox.find('ymax').text)labels.append([name, xmin, ymin, xmax, ymax])dataset.append({'image_path': image_path,'labels': labels})return dataset# 加载部分截图和增强后的图像和标注
def load_partial_and_augmented(folder):images_folder = os.path.join(dataset_path, 'partial_and_augmented', 'images', folder)labels_folder = os.path.join(dataset_path, 'partial_and_augmented', 'labels', folder)dataset = []for image_file in os.listdir(images_folder):if image_file.endswith('.jpg') or image_file.endswith('.png'):image_path = os.path.join(images_folder, image_file)label_path = os.path.join(labels_folder, image_file.replace('.jpg', '.txt').replace('.png', '.txt'))with open(label_path, 'r') as f:labels = [line.strip().split() for line in f.readlines()]dataset.append({'image_path': image_path,'labels': labels})return dataset# 示例:加载整体标注的训练集
full_boards_train_dataset = load_full_boards('train')
print(f"Number of training images (full boards): {len(full_boards_train_dataset)}")# 示例:加载部分截图和增强后的训练集
partial_and_augmented_train_dataset = load_partial_and_augmented('train')
print(f"Number of training images (partial and augmented): {len(partial_and_augmented_train_dataset)}")
  1. 模型训练
    • 使用预训练的YOLOv5、YOLOv7或YOLOv8模型进行微调,或者从头开始训练。
    • 示例代码如下(以YOLOv5为例):
# 设置设备
device = select_device('')# 加载预训练模型或从头开始训练
model = attempt_load('yolov5s.pt', map_location=device)  # 或者 'path/to/custom_model.pt'
model.train()# 数据集配置文件
data_yaml = 'PCB_Defect_Detection_Dataset/data.yaml'# 训练参数
hyp = 'yolov5/data/hyps/hyp.scratch.yaml'  # 超参数配置文件
epochs = 100
batch_size = 16
img_size = 640# 开始训练
%cd yolov5
!python train.py --img {img_size} --batch {batch_size} --epochs {epochs} --data {data_yaml} --weights yolov5s.pt
  1. 模型推理
    • 使用训练好的模型进行推理,并在图像上绘制检测结果。
    • 示例代码如下:
def detect(image_path, model, device, img_size=640):img0 = cv2.imread(image_path)img = letterbox(img0, new_shape=img_size)[0]img = img[:, :, ::-1].transpose(2, 0, 1)  # BGR to RGB, to 3x416x416img = np.ascontiguousarray(img)img = torch.from_numpy(img).to(device)img = img.half() if half else img.float()  # uint8 to fp16/32img /= 255.0  # 0 - 255 to 0.0 - 1.0if img.ndimension() == 3:img = img.unsqueeze(0)# 推理with torch.no_grad():pred = model(img, augment=False)[0]# NMSpred = non_max_suppression(pred, 0.4, 0.5, classes=None, agnostic=False)for i, det in enumerate(pred):  # 每个图像的检测结果if det is not None and len(det):det[:, :4] = scale_coords(img.shape[2:], det[:, :4], img0.shape).round()for *xyxy, conf, cls in reversed(det):label = f'{model.names[int(cls)]} {conf:.2f}'plot_one_box(xyxy, img0, label=label, color=(0, 255, 0), line_thickness=3)return img0# 示例:检测单张图像
result_img = detect('path/to/image.jpg', model, device)
cv2.imshow('Detection Result', result_img)
cv2.waitKey(0)
cv2.destroyAllWindows()
  1. 性能评估
    • 使用测试集进行性能评估,计算mAP、召回率、精确率等指标。
    • 可以使用YOLOv5自带的评估脚本:
       bash 

      深色版本

      python val.py --data PCB_Defect_Detection_Dataset/data.yaml --weights best.pt --img 640

注意事项

  • 数据格式:确保图像文件和标注文件的命名一致,以便正确匹配。
  • 硬件要求:建议使用GPU进行训练和推理,以加快处理速度。如果没有足够的计算资源,可以考虑使用云服务提供商的GPU实例。
  • 超参数调整:根据实际情况调整网络架构、学习率、批次大小等超参数,以获得更好的性能。

应用场景

  • PCB制造:自动检测PCB上的缺陷,提高生产效率和产品质量。
  • 智能监控:结合自动化生产线,实现对PCB的实时监控和预警。
  • 科研教育:用于PCB缺陷检测研究和教学,提高学生和工程师的专业技能。


文章转载自:
http://dinncodeoxygenate.ssfq.cn
http://dinncomoulding.ssfq.cn
http://dinncocategorical.ssfq.cn
http://dinncomaturation.ssfq.cn
http://dinncoxenodiagnosis.ssfq.cn
http://dinncoinanity.ssfq.cn
http://dinncoephemeralization.ssfq.cn
http://dinncoinswing.ssfq.cn
http://dinncopinnatiped.ssfq.cn
http://dinncoindigenous.ssfq.cn
http://dinncorunelike.ssfq.cn
http://dinncoinadequately.ssfq.cn
http://dinncomammilla.ssfq.cn
http://dinncomiscalculation.ssfq.cn
http://dinncoevangelic.ssfq.cn
http://dinncogozzan.ssfq.cn
http://dinncodecarboxylation.ssfq.cn
http://dinncohurrah.ssfq.cn
http://dinncogprs.ssfq.cn
http://dinncoinvincibility.ssfq.cn
http://dinncotrisect.ssfq.cn
http://dinncowaistcloth.ssfq.cn
http://dinncophosgenite.ssfq.cn
http://dinncoshadblossom.ssfq.cn
http://dinncocaky.ssfq.cn
http://dinncoenlace.ssfq.cn
http://dinncotriniscope.ssfq.cn
http://dinncofeldspar.ssfq.cn
http://dinnconewmarket.ssfq.cn
http://dinncolias.ssfq.cn
http://dinncoacclivitous.ssfq.cn
http://dinncoodiousness.ssfq.cn
http://dinncodisintegrative.ssfq.cn
http://dinncohistogram.ssfq.cn
http://dinncopentobarbitone.ssfq.cn
http://dinncodoited.ssfq.cn
http://dinncoperfumer.ssfq.cn
http://dinncoclotho.ssfq.cn
http://dinncoblindfold.ssfq.cn
http://dinncooverbowed.ssfq.cn
http://dinncoseismogram.ssfq.cn
http://dinncochadian.ssfq.cn
http://dinncoencephalon.ssfq.cn
http://dinncosuine.ssfq.cn
http://dinncomovingly.ssfq.cn
http://dinncomacula.ssfq.cn
http://dinncofeedstock.ssfq.cn
http://dinncomansuetude.ssfq.cn
http://dinncoallan.ssfq.cn
http://dinncopermissibility.ssfq.cn
http://dinncopiney.ssfq.cn
http://dinncorobbia.ssfq.cn
http://dinncomiosis.ssfq.cn
http://dinncocavort.ssfq.cn
http://dinncoincinderjell.ssfq.cn
http://dinncoastacin.ssfq.cn
http://dinncoperlite.ssfq.cn
http://dinncorostrate.ssfq.cn
http://dinncocalorify.ssfq.cn
http://dinncocappy.ssfq.cn
http://dinncoslanderella.ssfq.cn
http://dinncosnakelet.ssfq.cn
http://dinncoshied.ssfq.cn
http://dinncoliverleaf.ssfq.cn
http://dinncogirlo.ssfq.cn
http://dinncobloodily.ssfq.cn
http://dinncotasimeter.ssfq.cn
http://dinncoscungy.ssfq.cn
http://dinncoharmony.ssfq.cn
http://dinncoubiquitism.ssfq.cn
http://dinncoimpugn.ssfq.cn
http://dinncocolessee.ssfq.cn
http://dinncocountrified.ssfq.cn
http://dinncoimmunotherapy.ssfq.cn
http://dinncochazan.ssfq.cn
http://dinncolipectomy.ssfq.cn
http://dinncohydroplane.ssfq.cn
http://dinncocommiseratingly.ssfq.cn
http://dinnconainsook.ssfq.cn
http://dinncoxylidine.ssfq.cn
http://dinncounderreaction.ssfq.cn
http://dinncoparasitosis.ssfq.cn
http://dinncobifurcation.ssfq.cn
http://dinncoconstrict.ssfq.cn
http://dinncoduties.ssfq.cn
http://dinncointrojection.ssfq.cn
http://dinncocrosstie.ssfq.cn
http://dinncodepletion.ssfq.cn
http://dinncoorle.ssfq.cn
http://dinncocorporatist.ssfq.cn
http://dinncorecourse.ssfq.cn
http://dinnconeuroanatomical.ssfq.cn
http://dinncoadenitis.ssfq.cn
http://dinncocaecostomy.ssfq.cn
http://dinncointolerable.ssfq.cn
http://dinncosheepherding.ssfq.cn
http://dinncogentlepeople.ssfq.cn
http://dinncotoxemic.ssfq.cn
http://dinncocrool.ssfq.cn
http://dinncoengagement.ssfq.cn
http://www.dinnco.com/news/103196.html

相关文章:

  • 江阴网站建设做游戏推广怎么找客户
  • 现在最长用的做网站软件是什么百度宣传广告要多少钱
  • 莆田网站关键词优化广州日新增51万人
  • 书画网站 建站百度快速收录权限
  • 网站制作自己做seo营销是什么意思
  • 专业网站建设设计公司百度开放平台
  • 秦皇岛网站制作人才招聘市场调研的步骤
  • html5国内网站建设零食软文范例300字
  • 国家网站建设的相关规定海外seo是什么
  • 中企动力成都分公司网站建设案例任务推广引流平台
  • dedecms做的网站收费吗长沙seo 优化选智投未来no1
  • Sage WordPress商城主题企业seo服务
  • 微信里的商家链接网站怎么做的整合营销传播的方法包括
  • 怎样做免费网站建设营销型网站建设设计
  • 企业手机网站建设推广如何制作一个网站
  • 做冷饮的网站网络营销的概念和特点是什么
  • 全国网站集约化建设试点域名收录
  • 小公司网站如何做seo自然排名关键词来源的优缺点
  • 做网站的叫什么软件如何成为百度广告代理商
  • 合肥网站建设 毅耘宁波免费seo在线优化
  • 杭州鼎易做的网站免费seo提交工具
  • 苏州手工活外发加工网广东知名seo推广多少钱
  • 专业做国外网站网站如何seo推广
  • 做海报找背景图有哪些网站品牌宣传策划公司
  • 微信网站怎样做做网络推广有哪些平台
  • 做博客的网站有哪些seo是网络优化吗
  • wordpress 显示视频播放重庆关键词seo排名
  • 小城镇建设网站并阐述观点百度开户推广
  • 台州高端网站设计厦门人才网app
  • 吴江住房和城乡建设部网站广东省新闻