SSD目标检测lmdb数据结构剖析
SSD读取训练集是从LMDB中读取AnnotatedDatum结构的数据,在训练和测试之前,要将图片(img)和XML(label)数据存储为AnnotatedDatum结构,然后将数据经过序列化,存入到LMDB数据库中。训练和测试的时候直接从LMDB读取数据,经过反序列化获取AnnotatedDatum结构的数据,获得训练集的图片和XML数据。 可以参考ssd caffe目录包下的src/caffe/util/io.cpp, tools/convert_annoset.cpp,会对你理解数据结构有很大的作用。 也是C++ 强大的动态内存管理推波助澜。 AnnotatedData数据结构 message AnnotatedDataParameter { // Define the sampler. repeated BatchSampler batch_sampler = 1; // Store label name and label id in LabelMap format. optional string label_map_file = 2; // If provided, it will replace the AnnotationType stored in each // AnnotatedDatum. optional AnnotatedDatum