网站做一半能退吗,小程序二级分销系统,网站建设费计入无形资产,网站收录大量下降道路裂缝#xff0c;坑洼#xff0c;病害数据集 包括无人机视角#xff0c;摩托车视角#xff0c;车辆视角 覆盖道路所有问题 一共有八类16000张 1到7依次为: [横向裂缝, 纵向裂缝, 块状裂缝, 龟裂, 坑槽, 修补网状裂缝, 修补裂缝, 修补坑槽] 道路病害#xff08;如裂缝、…道路裂缝坑洼病害数据集 包括无人机视角摩托车视角车辆视角 覆盖道路所有问题 一共有八类16000张 1到7依次为: [横向裂缝, 纵向裂缝, 块状裂缝, 龟裂, 坑槽, 修补网状裂缝, 修补裂缝, 修补坑槽] 道路病害如裂缝、坑洼等不仅影响行车安全还会缩短道路使用寿命。传统的道路检查依赖人工巡检效率低下且容易遗漏。随着无人机、摩托车和车辆视角拍摄技术的发展自动化的道路病害检测成为可能。本数据集旨在为道路裂缝、坑洼及病害检测提供高质量的标注数据支持自动化检测系统的开发与应用。 数据集概述
名称道路裂缝、坑洼及病害检测数据集规模共计16,000张图像类别八类道路病害 1横向裂缝Transverse Cracks2纵向裂缝Longitudinal Cracks3块状裂缝Block Cracks4龟裂Alligator Cracking5坑槽Potholes6修补网状裂缝Mesh Cracking Repair7修补裂缝Crack Repair8修补坑槽Pothole Repair视角涵盖无人机视角、摩托车视角和车辆视角
数据集特点
全面性涵盖多种道路病害类型确保数据集的多样性和实用性。高质量标注每张图像都已详细标注确保数据的准确性和可靠性。适用范围广支持多种标注格式VOC、YOLO方便科研人员和开发者直接使用。标准格式采用广泛使用的标注文件格式方便导入不同的检测框架。
数据集内容 横向裂缝Transverse Cracks标注了道路上的横向裂缝。纵向裂缝Longitudinal Cracks标注了道路上的纵向裂缝。块状裂缝Block Cracks标注了道路上的块状裂缝。龟裂Alligator Cracking标注了道路上的龟裂。坑槽Potholes标注了道路上的坑槽。修补网状裂缝Mesh Cracking Repair标注了修补过的网状裂缝。修补裂缝Crack Repair标注了修补过的裂缝。修补坑槽Pothole Repair标注了修补过的坑槽。
数据集用途 病害检测可用于训练和评估深度学习模型特别是在道路裂缝、坑洼及病害检测方面。养护管理帮助实现道路养护的自动化检测减少人工巡查的工作量。科研与教育为道路裂缝、坑洼及病害检测领域的研究和教学提供丰富的数据支持。
使用场景
实时监控在道路监控系统中利用该数据集训练的模型可以实时检测道路病害。养护规划在道路养护和修复计划制定中利用该数据集可以提高检测的准确性和速度。生产管理在道路管理和养护工作中利用该数据集可以提高工作效率和管理水平。
技术指标
数据量共计16,000张图像涵盖八类道路病害。数据划分数据集是否进行了训练集、验证集和测试集的划分需根据数据集实际内容确定。标注格式支持VOC和YOLO格式的标注文件方便导入不同的检测框架。标注精度所有图像均已详细标注确保数据的准确性和可靠性。
注意事项
数据隐私在使用过程中请确保遵守相关法律法规保护个人隐私。数据预处理在使用前建议进行一定的数据预处理如图像归一化等。
获取方式
下载链接请访问项目主页获取数据集下载链接。许可证请仔细阅读数据集的使用许可协议。
关键代码示例
以下是关键代码的示例包括数据加载、模型训练、检测和结果展示。
数据加载以VOC格式为例
1import os
2import cv2
3import xml.etree.ElementTree as ET
4import numpy as np
5
6# 数据集路径
7DATASET_PATH path/to/dataset
8IMAGES_DIR os.path.join(DATASET_PATH, JPEGImages)
9ANNOTATIONS_DIR os.path.join(DATASET_PATH, Annotations)
10
11# 加载数据集
12def load_dataset(directory):
13 images []
14 annotations []
15
16 for img_file in os.listdir(IMAGES_DIR):
17 if img_file.endswith(.jpg) or img_file.endswith(.png):
18 img_path os.path.join(IMAGES_DIR, img_file)
19 annotation_path os.path.join(ANNOTATIONS_DIR, img_file.replace(.jpg, .xml).replace(.png, .xml))
20
21 image cv2.imread(img_path)
22 tree ET.parse(annotation_path)
23 root tree.getroot()
24
25 objects []
26 for obj in root.findall(object):
27 name obj.find(name).text
28 bbox obj.find(bndbox)
29 xmin int(bbox.find(xmin).text)
30 ymin int(bbox.find(ymin).text)
31 xmax int(bbox.find(xmax).text)
32 ymax int(bbox.find(ymax).text)
33 objects.append((name, [xmin, ymin, xmax, ymax]))
34
35 images.append(image)
36 annotations.append(objects)
37
38 return images, annotations
39
40train_images, train_annotations load_dataset(os.path.join(DATASET_PATH, train))
41val_images, val_annotations load_dataset(os.path.join(DATASET_PATH, val))
42test_images, test_annotations load_dataset(os.path.join(DATASET_PATH, test))
模型训练
1# 初始化YOLOv8模型
2model YOLO(yolov8n.pt)
3
4# 转换VOC格式到YOLO格式
5def convert_voc_to_yolo(annotations, image_shape(640, 640), class_names[Transverse Cracks, Longitudinal Cracks, Block Cracks, Alligator Cracking, Potholes, Mesh Cracking Repair, Crack Repair, Pothole Repair]):
6 yolo_annotations []
7 class_map {name: i for i, name in enumerate(class_names)}
8
9 for ann in annotations:
10 converted []
11 for name, obj in ann:
12 class_id class_map[name]
13 x_center (obj[0] obj[2]) / 2 / image_shape[1]
14 y_center (obj[1] obj[3]) / 2 / image_shape[0]
15 width (obj[2] - obj[0]) / image_shape[1]
16 height (obj[3] - obj[1]) / image_shape[0]
17 converted.append([class_id, x_center, y_center, width, height])
18 yolo_annotations.append(converted)
19 return yolo_annotations
20
21# 定义训练参数
22EPOCHS 100
23BATCH_SIZE 16
24
25# 转换并训练模型
26train_yolo_annots convert_voc_to_yolo(train_annotations)
27val_yolo_annots convert_voc_to_yolo(val_annotations)
28
29results model.train(dataroad_disease_detection.yaml, epochsEPOCHS, batchBATCH_SIZE)
模型检测
1# 加载训练好的模型
2model YOLO(best.pt)
3
4# 检测图像
5def detect_road_diseases(image):
6 results model.predict(image)
7 for result in results:
8 boxes result.boxes
9 for box in boxes:
10 x1, y1, x2, y2 box.xyxy[0]
11 conf box.conf
12 class_id box.cls
13
14 # 显示结果
15 cv2.rectangle(image, (int(x1), int(y1)), (int(x2), int(y2)), (0, 255, 0), 2)
16 class_name [Transverse Cracks, Longitudinal Cracks, Block Cracks, Alligator Cracking, Potholes, Mesh Cracking Repair, Crack Repair, Pothole Repair][class_id]
17 cv2.putText(image, f{class_name}, Conf: {conf:.2f}, (int(x1), int(y1)-10), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 255, 0), 2)
18
19 return image
20
21# 测试图像
22test_image cv2.imread(path/to/test_image.jpg)
23result_image detect_road_diseases(test_image)
24cv2.imshow(Detected Road Diseases, result_image)
25cv2.waitKey(0)
26cv2.destroyAllWindows()
配置文件 road_disease_detection.yaml
1train: path/to/train/images
2val: path/to/val/images
3test: path/to/test/images
4
5nc: 8 # Number of classes
6names: [Transverse Cracks, Longitudinal Cracks, Block Cracks, Alligator Cracking, Potholes, Mesh Cracking Repair, Crack Repair, Pothole Repair] # Class names
7
8# Training parameters
9batch_size: 16
10epochs: 100
11img_size: [640, 640] # Image size
使用指南
数据准备确保数据集路径正确并且数据集已准备好。模型训练运行训练脚本等待训练完成。模型检测使用训练好的模型进行检测并查看检测结果。
结语
本数据集提供了一个高质量的道路裂缝、坑洼及病害检测数据集支持自动化病害检测、养护管理等多个应用场景。通过利用该数据集训练的模型可以提高道路病害检测的效率和准确性。