无人机视角垃圾检测数据集,26700余张无人机图像,超过4万标注信息,共3.6GB数据量,可用于环卫快速检查,垃圾快速定位等应用。

 无人机视角垃圾检测,26700余张无人机图像,超过4万标注信息,共3.6GB数据量,可用于环卫快速检查,垃圾快速定位等应用。

名称

无人机视角垃圾检测数据集

规模
  • 图像数量:26700余张
  • 标注信息:超过4万条
  • 数据量:约3.6GB
数据特点
  • 高分辨率:所有图像均为高分辨率,能够提供丰富的细节信息,有助于提高检测精度。
  • 多样化场景:图像采集自多种环境和场景,包括城市街道、公园、海滩等,涵盖了不同类型的垃圾。
  • 详细标注:每张图像都附有详细的边界框标注,标明了垃圾的位置和类别。
  • 多类垃圾:数据集涵盖了多种常见的垃圾类型,如塑料瓶、纸张、烟蒂、食品包装等。
应用场景
  • 环卫快速检查:通过无人机进行大面积的环境监测,快速发现并定位垃圾,提高环卫工作的效率。
  • 垃圾快速定位:帮助相关部门及时清理垃圾,减少对环境的影响。
  • 智能城市管理:集成到智能城市管理系统中,提升城市的整体清洁度和管理水平。
  • 环境保护:支持环保项目,监测和评估特定区域的垃圾污染情况,为环境保护措施提供依据。
  • 研究与教育:用于科研机构的研究以及相关院校的教学,帮助学生和研究人员更好地了解垃圾检测技术。

数据集结构

假设数据集的文件结构如下:

drone_waste_detection_dataset/
├── images/
│   ├── image_0001.jpg
│   ├── image_0002.jpg
│   └── ...
├── annotations/
│   ├── annotation_0001.xml
│   ├── annotation_0002.xml
│   └── ...
└── metadata.csv

metadata.csv 文件内容示例:

image_id, location, date, time
image_0001, City Park, 2023-01-01, 10:00:00
image_0002, Beach, 2023-01-01, 10:05:00
...

annotations/annotation_0001.xml 示例(使用Pascal VOC格式):

<annotation>
    <folder>drone_waste_detection_dataset</folder>
    <filename>image_0001.jpg</filename>
    <size>
        <width>1024</width>
        <height>768</height>
        <depth>3</depth>
    </size>
    <object>
        <name>Plastic Bottle</name>
        <bndbox>
            <xmin>150</xmin>
            <ymin>200</ymin>
            <xmax>350</xmax>
            <ymax>400</ymax>
        </bndbox>
    </object>
    <object>
        <name>Paper</name>
        <bndbox>
            <xmin>400</xmin>
            <ymin>300</ymin>
            <xmax>500</xmax>
            <ymax>400</ymax>
        </bndbox>
    </object>
    ...
</annotation>

代码示例

下面是一个简单的Python脚本示例,展示如何加载和可视化这些数据集的一部分。我们将使用OpenCV来读取图像,并使用xml.etree.ElementTree来解析VOC格式的标注文件。

import os
import cv2
from xml.etree import ElementTree as ET
import pandas as pd

def parse_voc_annotation(xml_file):
    tree = ET.parse(xml_file)
    root = tree.getroot()
    
    boxes = []
    labels = []
    
    for obj in root.findall('object'):
        label = obj.find('name').text
        bndbox = 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)
        
        boxes.append([xmin, ymin, xmax, ymax])
        labels.append(label)
    
    return boxes, labels

def load_drone_data(image_dir, annotation_dir, metadata_file):
    images = []
    annotations = []
    metadata = pd.read_csv(metadata_file)
    
    for index, row in metadata.iterrows():
        image_id = row['image_id']
        location = row['location']
        date = row['date']
        time = row['time']
        
        # 加载图像
        img_path = os.path.join(image_dir, f"{image_id}.jpg")
        image = cv2.imread(img_path)
        
        # 加载对应的标注
        annotation_filename = f"annotation_{image_id.split('_')[1]}.xml"
        annotation_path = os.path.join(annotation_dir, annotation_filename)
        boxes, labels = parse_voc_annotation(annotation_path)
        
        if image is not None:
            images.append((image, location, date, time))
            annotations.append((boxes, labels))
        else:
            print(f"Failed to load image: {img_path}")
    
    return images, annotations, metadata

# 假设图像存储在'image'目录下,标注文件存储在'annotations'目录下,元数据文件为'metadata.csv'
image_dir = 'path_to_your_image_directory'
annotation_dir = 'path_to_your_annotation_directory'
metadata_file = 'path_to_your_metadata_file'

images, annotations, metadata = load_drone_data(image_dir, annotation_dir, metadata_file)

# 显示第一张图像及其对应的标注框
img, location, date, time = images[0]
boxes, labels = annotations[0]

for box, label in zip(boxes, labels):
    (xmin, ymin, xmax, ymax) = box
    cv2.rectangle(img, (xmin, ymin), (xmax, ymax), (0, 255, 0), 2)
    cv2.putText(img, label, (xmin, ymin - 10), cv2.FONT_HERSHEY_SIMPLEX, 0.9, (36, 255, 12), 2)

cv2.imshow('Image with Annotations', img)
cv2.setWindowTitle('Image', f'Image: Location {location}, Date {date}, Time {time}')
cv2.waitKey(0)
cv2.destroyAllWindows()

说明

  • 路径设置:请根据实际的数据集路径调整path_to_your_image_directorypath_to_your_annotation_directorypath_to_your_metadata_file
  • 文件命名:假设图像文件名分别为.jpg,标注文件为.xml。如果实际命名规则不同,请相应修改代码。
  • 可视化:通过绘制边界框和标签,可以直观地看到图像中的垃圾位置和类别。

进一步的应用

  • 训练深度学习模型:可以使用这个数据集来训练卷积神经网络(CNN)或其他机器学习模型,以实现自动化的垃圾检测。
  • 数据增强:为了增加数据集的多样性和鲁棒性,可以使用数据增强技术(如旋转、翻转、缩放等)生成更多的训练样本。
  • 评估与优化:通过交叉验证和测试集评估模型性能,并不断优化模型参数,以提高检测准确率。

这个数据集对于无人机视角下的垃圾检测具有重要的实用价值,可以帮助相关部门高效地进行环境监测和垃圾清理工作,提升城市环境卫生水平。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

QQ_1309399183

一角两角不嫌少

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值