自学内容网 自学内容网

智能手机表面缺陷识别检测数据集 yolo数据集 1300张

智能手机表面缺陷识别检测数据集 yolo数据集 1300张

数据集名称

智能手机表面缺陷识别检测数据集(Smartphone Surface Defect Recognition Dataset)

数据集概述

该数据集是针对智能手机表面常见缺陷进行自动检测而专门构建的,主要应用于生产线上产品的质量控制或者售后服务部门的产品维修。数据集包含1300张高清图像,每张图像都有详细的YOLO格式标注,覆盖了8种类型的缺陷,包括破碎玻璃、芯片、裂纹、凹痕、缺失部件、剥落、点蚀、划痕和磨损。数据集具有良好的多样性和代表性,可帮助研究人员和工程师开发出高效的缺陷检测算法,提升产品质量和客户满意度。

数据集特点
  • 丰富多样的缺陷类型:涵盖8种常见的智能手机表面缺陷,满足实际应用的需求。
  • 大量标注图像:总共1300张图像,保证了足够的训练数据量。
  • 标准YOLO格式:所有图像都带有YOLO格式的标注,易于与其他YOLO框架配合使用。
  • 全面的缺陷分类:每个缺陷类别均有足够数量的实例,有利于模型的训练和泛化。
  • 真实场景:图像来源于真实的智能手机产品,反映了实际情况下的缺陷分布。
  • 数据集划分:数据集可能已按一定比例分为训练集、验证集和测试集,具体划分方式取决于数据集发布方的设计。
数据集构成

  • 图像数量:1300张
  • 类别数
    • broken_glass:154个实例
    • chip:69个实例
    • crack:674个实例
    • dent:463个实例
    • missing_part:2个实例
    • peel:26个实例
    • pitting:147个实例
    • scratch:3036个实例
    • water_damage:33个实例
    • wear_and_tear:8个实例
数据集用途
  • 缺陷检测算法开发:利用数据集训练和优化缺陷检测算法,提高检测准确度和速度。
  • 生产线质量控制:将训练好的模型部署到生产线上,实现自动化的缺陷检测,降低人工成本。
  • 售后维修服务:帮助售后服务中心快速判断和处理客户的设备问题,提高服务质量。
  • 性能评估:作为基准数据集,对比不同算法或模型的性能差异。
  • 研究与开发:支持学术界和工业界的缺陷检测研究,推动技术创新。
  • 教育与培训:作为教学材料,帮助学生了解实际应用场景下的机器学习问题解决过程。
示例代码

以下是一个简单的Python脚本示例,用于加载数据集中的一对图像-标签对,并可视化其中的标注信息:

import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle

# 数据集目录路径
data_dir = 'path/to/smartphone_defect_dataset'
train_image_dir = os.path.join(data_dir, 'images/train')
train_label_dir = os.path.join(data_dir, 'labels/train')

# 选取一张训练图像及其对应标签
image_files = os.listdir(train_image_dir)
image_file = image_files[0]  # 假设取第一张图
label_file = os.path.splitext(image_file)[0] + '.txt'

image_path = os.path.join(train_image_dir, image_file)
label_path = os.path.join(train_label_dir, label_file)

# 加载图像
image = cv2.imread(image_path, cv2.IMREAD_COLOR)
height, width, _ = image.shape

# 解析YOLO格式标签
def parse_yolo_label(label_path, image_width, image_height):
    bboxes = []
    with open(label_path, 'r') as f:
        lines = f.readlines()
        for line in lines:
            class_id, x_center, y_center, box_width, box_height = map(float, line.strip().split())
            x_min = int((x_center - box_width / 2) * image_width)
            y_min = int((y_center - box_height / 2) * image_height)
            box_width = int(box_width * image_width)
            box_height = int(box_height * image_height)
            bboxes.append((class_id, x_min, y_min, box_width, box_height))

    return bboxes

# 解析标签
bboxes = parse_yolo_label(label_path, width, height)

# 可视化标注
fig, ax = plt.subplots(figsize=(10, 10))
ax.imshow(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
colors = ['red', 'blue', 'green', 'orange', 'purple', 'yellow', 'pink', 'brown']
names = ['broken_glass', 'chip', 'crack', 'dent', 'missing_part', 'peel', 'pitting', 'scratch', 'water_damage', 'wear and tear']

for bbox, color_name in zip(bboxes, colors):
    class_id, x, y, w, h = bbox
    rect = Rectangle((x, y), w, h, linewidth=2, edgecolor=color_name, facecolor='none')
    ax.add_patch(rect)
    ax.text(x, y - 10, names[int(class_id)], color=color_name, fontsize=8)

plt.title('Smartphone Surface Defect Detection')
plt.axis('off')
plt.show()
数据集结构示例
├── smartphone_defect_dataset
│   ├── images
│   │   ├── train
│   │   │   ├── 00000.jpg
│   │   │   ├── 00001.jpg
│   │   │   └── ...
│   │   ├── validation
│   │   │   ├── 00000.jpg
│   │   │   ├── 00001.jpg
│   │   │   └── ...
│   │   └── test
│   │       ├── 00000.jpg
│   │       ├── 00001.jpg
│   │       └── ...
│   ├── labels
│   │   ├── train
│   │   │   ├── 00000.txt
│   │   │   ├── 00001.txt
│   │   │   └── ...
│   │   ├── validation
│   │   │   ├── 00000.txt
│   │   │   ├── 00001.txt
│   │   │   └── ...
│   │   └── test
│   │       ├── 00000.txt
│   │       ├── 00001.txt
│   │       └── ...
│   └── data.yaml  # 包含数据集的基本信息如类别数及类别名

原文地址:https://blog.csdn.net/2301_78240361/article/details/142479575

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!