2

I'm training custom image data sets for object detection using caffe. Here i have train and validation directory. By using LabelImg , the object annotation created in a .xml file for each image separately (image1.xml,image2.xml etc.). Now i want to convert all this xml files into train.txt and val.txt. How can i do it? I stuck in this step since 3 weeks

218.xml

`<annotation>
    <folder>train</folder>
    <filename>218</filename>
    <path>C:\kp\images\train\218.jpg</path>
    <source>
        <database>Unknown</database>
    </source>
    <size>
        <width>352</width>
        <height>288</height>
        <depth>3</depth>
    </size>
    <segmented>0</segmented>
    <object>
        <name>person</name>
        <pose>Unspecified</pose>
        <truncated>0</truncated>
        <difficult>0</difficult>
        <bndbox>
            <xmin>79</xmin>
            <ymin>56</ymin>
            <xmax>262</xmax>
            <ymax>283</ymax>
        </bndbox>
    </object>
</annotation>`

For each image i have created annotation.xml file (image_name.xml) by using the tool. Now i need to convert it into train.txt and val.txt for input to the create LMDB. I have already gone through Caffe LMDB train and val.txt , how to make train.txt file in caffe , A guide to convert_imageset.cpp , https://github.com/chuanqi305/MobileNet-SSD/issues/90

But everything is for object classification and and others didn't explain it too.. Any suggestions or help will be appreciated

Hong-333
  • 81
  • 9
Kpras
  • 63
  • 1
  • 13

1 Answers1

1

train.txt

imagepath xmlpath

image/image1.jpg label/image1.xml
image/image2.jpg label/image2.xml
image/image3.jpg label/image3.xml
image/image4.jpg label/image4.xml
...

this is train.txt or test.txt

Hong-333
  • 81
  • 9
  • is this format of train.txt and val.txt for LMDB input in the caffe training? – Kpras Aug 29 '19 at 05:57
  • Please look at this https://github.com/chuanqi305/MobileNet-SSD/issues/90#issuecomment-390118638 and https://xiaoyuliu.github.io/2018/02/23/combine-datasets-into-lmdb-for-caffe/ I think your answer is wrong – Kpras Aug 29 '19 at 06:43
  • that is right I have already train that way https://tolotra.com/2018/09/15/how-to-retrain-ssd-mobilenet-for-real-time-object-detection-using-a-raspberry-pi-and-movidius-neural-compute-stick/ check this page you can train easilly – Hong-333 Aug 29 '19 at 07:07