因为想用yolo来做行人检测,所以尝试下载了caltech的行人检测数据集来fine-tuning。
首先去官网(http://www.vision.caltech.edu/Image_Datasets/CaltechPedestrians/)下载数据集
但是下载的数据,是seq格式,说明则为vbb格式,所以先要处理一下,变成yolo需要的jpg和txt。
用python写的将.seq 转为.jpg的代码, rootdir为.seq文件的文件夹,结果为每一帧的图像。
import os.path
import fnmatch
import shutil
def open_save(file,savepath):
# read .seq file, and save the images into the savepath
f = open(file,'rb')
string = str(f.read())
splitstring = "\xFF\xD8\xFF\xE0\x00\x10\x4A\x46\x49\x46"
# split .seq file into segment with the image prefix
strlist=string.split(splitstring)
f.close()
count = 0
# delete the image folder path if it exists
if os.path.exists(savepath):
shutil.rmtree(savepath)
# create the image folder path
if not os.path.exists(savepath):