# -*- coding:utf-8 -*-
import os
import xml.etree.ElementTree as ET
import numpy as np
np.set_printoptions(suppress=True, threshold=1000000)
import matplotlib
from PIL import Image
def parse_obj(xml_path, filename):
tree = ET.parse(xml_path + filename)
objects = []
for obj in tree.findall('object'):
obj_struct = {}
obj_struct['name'] = obj.find('name').text
objects.append(obj_struct)
return objects
def read_image(image_path, filename):
im = Image.open(image_path + filename)
W = im.size[0]
H = im.size[1]
area = W * H
im_info = [W, H, area]
return im_info
if __name__ == '__main__':
xml_path = './Annotations/'
filenamess = os.listdir(xml_path)
filenames = []
for name in filenamess:
name = name.replace('.xml', '')
filenames.append(name)
recs = {}
obs_shape = {}
classnames = []
num_objs = {}
obj_avg = {}
for i, name in enumerate(filenames):
recs[name] = parse_obj(xml_path, name + '.xml')
for name in filenames:
for object in recs[name]:
if object['name'] not in num_objs.keys():
num_objs[object['name']] = 1
else:
num_objs[object['name']] += 1
if object['name'] not in classnames:
classnames.append(object['name'])
for name in classnames:
print('{}:{}个'.format(name, num_objs[name]))
print('信息统计算完毕。')
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
道路病害数据集.详细:https://blog.csdn.net/qq_34717531/article/details/139122956?spm=1001.2014.3001.5502。该数据集分为二个部分,JPEGImages和Annotations。 道路病害数据集提供了一个全面而且精确的资源库,用于道路病害检测技术的开发和验证。该数据集包含超过23,000+张高质量的道路病害图像,这些图像涵盖了从城市街道到乡村道路,从高速公路到住宅区的各种道路场景。这样的多样化确保了数据集的广泛适用性和高实用性。 每张图片都经过了精心挑选,并且使用了labelimg工具进行了详细的人工标注。标注信息以XML文件格式存储在Annotations文件夹中,每个文件详细记录了图像中各种病害的位置、类型和其他相关属性,这为使用机器学习和深度学习模型进行道路病害识别提供了必要的地面真相数据。 JPEGImages文件夹内的图像质量高,清晰度好,这对于确保模型能够准确识别和学习道路病害特征至关重要。 免去了收集,挑选,标注道路病害图片的时间,可直接进行工程化应用。
资源推荐
资源详情
资源评论
收起资源包目录
优质道路病害数据集5.zip (2000个子文件)
leishu1.py 1KB
说明.txt 91B
China_MotorBike_001965.xml 3KB
China_MotorBike_001572.xml 3KB
China_MotorBike_001044.xml 3KB
China_MotorBike_001665.xml 2KB
China_MotorBike_001662.xml 2KB
United_States_001409.xml 2KB
China_MotorBike_001287.xml 2KB
China_MotorBike_001521.xml 2KB
China_MotorBike_001139.xml 2KB
China_MotorBike_001257.xml 2KB
United_States_001593.xml 2KB
United_States_000851.xml 2KB
United_States_002133.xml 2KB
United_States_002074.xml 2KB
United_States_003741.xml 2KB
China_MotorBike_001082.xml 2KB
United_States_001922.xml 2KB
United_States_004485.xml 2KB
China_MotorBike_001233.xml 2KB
China_MotorBike_001001.xml 2KB
China_MotorBike_001241.xml 2KB
China_MotorBike_001317.xml 2KB
China_MotorBike_001400.xml 2KB
China_MotorBike_001033.xml 2KB
United_States_003489.xml 2KB
China_MotorBike_001909.xml 2KB
United_States_004262.xml 2KB
China_MotorBike_001511.xml 2KB
United_States_000528.xml 2KB
United_States_004289.xml 2KB
United_States_003037.xml 2KB
United_States_002349.xml 2KB
United_States_000037.xml 2KB
United_States_003985.xml 2KB
United_States_003115.xml 2KB
United_States_004028.xml 2KB
United_States_001789.xml 2KB
United_States_003015.xml 2KB
United_States_002524.xml 2KB
United_States_000170.xml 2KB
United_States_004657.xml 2KB
United_States_000967.xml 2KB
China_MotorBike_001915.xml 2KB
United_States_004640.xml 2KB
China_MotorBike_001631.xml 2KB
China_MotorBike_001842.xml 2KB
China_MotorBike_001068.xml 2KB
United_States_003568.xml 2KB
United_States_004733.xml 2KB
United_States_004776.xml 2KB
United_States_003092.xml 2KB
United_States_000430.xml 2KB
China_MotorBike_001644.xml 2KB
United_States_003320.xml 2KB
United_States_002493.xml 2KB
United_States_004042.xml 2KB
United_States_003948.xml 2KB
China_MotorBike_001906.xml 2KB
United_States_000826.xml 2KB
United_States_002736.xml 2KB
United_States_000573.xml 2KB
United_States_002260.xml 2KB
United_States_004670.xml 2KB
China_MotorBike_001334.xml 2KB
United_States_000499.xml 2KB
United_States_004614.xml 2KB
United_States_000468.xml 2KB
United_States_004402.xml 2KB
United_States_004146.xml 2KB
United_States_001874.xml 2KB
United_States_000885.xml 2KB
United_States_003503.xml 2KB
United_States_001722.xml 2KB
United_States_001916.xml 2KB
China_MotorBike_001681.xml 2KB
China_MotorBike_001645.xml 2KB
United_States_000559.xml 2KB
United_States_001227.xml 2KB
United_States_003890.xml 2KB
United_States_001472.xml 2KB
United_States_003972.xml 2KB
United_States_001342.xml 2KB
China_MotorBike_001636.xml 2KB
China_MotorBike_001413.xml 2KB
United_States_003770.xml 2KB
United_States_002358.xml 2KB
United_States_002555.xml 2KB
United_States_001712.xml 2KB
United_States_000454.xml 2KB
United_States_002008.xml 2KB
United_States_000711.xml 2KB
United_States_004150.xml 2KB
United_States_000236.xml 2KB
United_States_002725.xml 2KB
United_States_002830.xml 2KB
China_MotorBike_001684.xml 1KB
China_MotorBike_001709.xml 1KB
China_MotorBike_001513.xml 1KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
学术菜鸟小晨
- 粉丝: 1w+
- 资源: 5001
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功