在将数据集整理为VOC格式时,遇到关于文件路径问题:
for i in range(0, len(ID)):
bbxes = bbox[i]
idx = ID[i]
path = "Human Body Image/%05d.jpg" % (idx) # 图片路径
if not shutil.os.path.exists(path):
print(path)
continue
im = io.imread(path)
head = headstr % (idx, im.shape[1], im.shape[0], im.shape[2])
writexml(idx, head, bbxes, tailstr)