简体   繁体   English

将XML文件转换为LMDB文件以获取Caffe

[英]Conver xml file to LMDB file for caffe

I want to use feature vectors which have been extracted from training image dataset as an input for caffe convolutional neural network. 我想使用从训练图像数据集中提取的特征向量作为caffe卷积神经网络的输入。 The feature vectors have been saved in xml file. 特征向量已保存在xml文件中。 I'm really new in caffe I want know how can I convert xml file to LMDB as an caffe input and how to mention in the model that I'm using feature vectors instead of images. 我真的是caffe的新手,我想知道如何将XML文件作为caffe输入转换为LMDB,以及如何在模型中提及我使用特征向量而不是图像。 the xml file is : xml文件是: 在此处输入图片说明

If you are willing to use python, then it should be quite easy for you. 如果您愿意使用python,那么对您来说应该很容易。

First, you need to parse the XML file and read the data into a numpy array. 首先,您需要解析XML文件并将数据读入numpy数组。
You can do this using xml python package . 您可以使用xml python package进行此操作。

The second stage is to write the data you have in numpy array into lmdb. 第二阶段是将numpy数组中的数据写入lmdb。
You can use this solution to write LMDB using python. 您可以使用此解决方案通过python编写LMDB。

Regarding caffe, as long as your input data is in order, caffe does not care if it works on images, feature vectors or any other input. 关于caffe,只要您的输入数据是有序的,caffe就不会在图像,特征向量或任何其他输入上使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM