文章目录
- DanceTrack 运动跟踪数据集
- 简介
- 转为Labelme标注的物体检测数据集格式
- WiderPerson行人检测数据集
- 简介
- 转为Labelme标注的物体检测数据集格式
DanceTrack 运动跟踪数据集
简介
DanceTrack 是一个大规模的多对象跟踪数据集。用于在遮挡、频繁交叉、同样服装和多样化身体姿态条件下对人进行跟踪。强调运动分析在多对象跟踪中的重要性。
GitHub地址:https://github.com/DanceTrack/DanceTrack
数据集下载地址:https://pan.baidu.com/s/19O3IvYNzzrcLqlODHKYUwA
提取码:awew
转为Labelme标注的物体检测数据集格式
import sys
import base64
import os
import cv2
import shutil
import glob
module_path = os.path.abspath(os.path.join('..'))
if module_path not in sys.path:
sys.path.append(module_path)
import json
from PIL import Image
Image.MAX_IMAGE_PIXELS = None
xmlpathNames_path='../train1/*/gt/gt.txt'
xmlpathNames=glob.glob(xmlpathNames_path)
print(xmlpathNames)
version = '3.16.7'
flags = {}
lineColor = [0, 255, 0, 128]
fillColor = [255, 0, 0, 128]
image_t='../images/'
os.makedirs(image_t,exist_ok=True)
for xmlpathName in xmlpathNames:
xmlpathName=xmlpathName.replace("\\","/")
dancetrack_name=xmlpathName.split("/")[-3]
dic_info = {}
with open(xmlpathName) as fs:
lines = fs.readlines()
lines = sorted(lines)
for line in lines:
line = line.replace("\n", '')
line_info = line.split(',')
frame = line_info[0]
frame_image_name = '{:0>8d}'.format(int(frame)) + ".jpg"
box = [int(line_info[2]), int(line_info[3]), int(line_info[2]) + int(line_info[4]),
int(line_info[3]) + int(line_info[5])]
if frame_image_name in dic_info:
box_list = dic_info[frame_image_name]
box_list.append(box)
dic_info[frame_image_name] = box_list
else:
box_list = [box]
dic_info[frame_image_name] = box_list
for image_name in dic_info.keys():
dic = {}
dic['version'] = version
dic['flags'] = flags
dic['shapes'] = []
img_path = "../train1/"+dancetrack_name+"/img1/" + image_name
img_new_name = dancetrack_name + "_" + image_name
img_new_path = image_t + img_new_name
try:
shutil.copy(img_path, image_t + img_new_name)
except :
continue
img = cv2.imread(img_new_path)
imageHeight, imageWidth, _ = img.shape
for data in dic_info[image_name]:
shape = {}
shape['label'] = 'person'
shape['line_color'] = None
shape['fill_color'] = None
x1 = int(data[0])
y1 = int(data[1])
x2 = int(data[2])
y2 = int(data[3])
shape['points'] = [[x1, y1], [x2, y2]]
shape['shape_type'] = 'rectangle'
shape['flags'] = {}
dic['shapes'].append(shape)
dic['lineColor'] = lineColor
dic['fillColor'] = fillColor
dic['imagePath'] = img_new_name
dic['imageData'] = base64.b64encode(
open('{}'.format(img_new_path), "rb").read()).decode('utf-8')
dic['imageHeight'] = imageHeight
dic['imageWidth'] = imageWidth
fw = open('{}json'.format(img_new_path.replace(img_new_path.split('.')[-1], "")), 'w')
json.dump(dic, fw)
fw.close()
WiderPerson行人检测数据集
简介
WiderPerson 是关于户外行人检测的基准数据集。该数据集图像场景多样,不再局限于交通场景。该数据集包含 13,382 张图像,40 万个遮挡物的标注,其中 8,000 张图像用于训练,1,000 张图像用于验证,4,382 张图像用于测试。与 CityPersons 和 WIDER FACE 数据集类似,该数据集不公布测试图像的 bounding box ground truth。该数据集包含密集的行人和各种遮挡,适合进行户外环境的行人检测评估。
官网地址:http://www.cbsr.ia.ac.cn/users/sfzhang/WiderPerson/
百度网盘:https://pan.baidu.com/s/1ulMlbw_zhNUYwdyXONLrwg
提取码:uq3u