2

I have downloaded PASCAL trainval.tar.gz and 33_context_labels and saved into two folders for running semantic segmentation. The trainval folder includes images with .mat format and ground truth images in 33_context_labels folder are in .png format.

  • How can I divide the training data (trainval folder) and corresponding label images (33_context_labels folder) into 2 sets: One for training (5/6 of images) and the other for validation (1/6 of images)?
  • How can I create LMDB files for the training and validation in 2 LMDB databases? (train_lmdb for training the model and validation_lmbd for model evaluation)

Your help is appreciated.

Thanks

Shai
  • 111,146
  • 38
  • 238
  • 371
S.EB
  • 1,966
  • 4
  • 29
  • 54
  • why lmdb and not HDF5? – Shai Dec 22 '16 at 12:33
  • 1
    see [this answer](http://stackoverflow.com/a/33628970/1714410) for more details. – Shai Dec 22 '16 at 12:36
  • you are most welcome. – Shai Dec 22 '16 at 14:21
  • @Shai Thanks a lot, but how we can create this file for each pixel for semantic segmentation. How it works? Could you please explain? – S.EB Dec 22 '16 at 14:23
  • 1
    you do not build a file per pixel, but rather a "label image" per input image. That is, instead of a scalar label per input image, you now have a label image with a label per input pixel. – Shai Dec 22 '16 at 14:25
  • @Shai thank you very much, but how we can relate label images to the corresponding original images? should I create one database for labels and another one for original images? – S.EB Dec 22 '16 at 14:40
  • 1
    you should be very careful when constructing the two lmdb to make sure they are in sync. please see [this linked answer](http://stackoverflow.com/questions/33627888/generating-lmdb-for-caffe?noredirect=1&lq=1) – Shai Dec 22 '16 at 14:53
  • @Shai Thank you very much for your help and support. I am beginner in Caffe and Python, and I asked a lot of questions. You are the only person that reply most of the time and very quickly. I really appreciate your help. – S.EB Dec 22 '16 at 15:33
  • glad I could help. I believe [tag:python] questions will get answers from more users... [tag:caffe] is a bit lonely ;) – Shai Dec 22 '16 at 15:35
  • @Shai, I think your contributions are worth writing up as an answer. – Prune Dec 22 '16 at 17:58
  • @Shai unfortunately, I am not able to convert to LMDB. Each image is in mat file format and labels are in another folder with mat file format. I have one channel images (grayscale). What solution do you suggest? thanks – S.EB Dec 26 '16 at 09:20
  • @S.EBif you have access to matlab (mat format is native to matlab) then read the files in matlab and convert them to hdf5 – Shai Dec 26 '16 at 09:38
  • @Shai My apologies for bothering you, in the [link] (http://stackoverflow.com/questions/31774953/test-labels-for-regression-caffe-float-not-allowed/31808324#31808324) , what is `'train.txt'` file that is opening? I do not have such file for my data. – S.EB Dec 26 '16 at 10:30
  • @S.EB the same input file as in convert_imageset: each line has a path to an image file and the corresponding ground truth label of that image – Shai Dec 26 '16 at 12:14
  • @Shai since I am quite new in Caffe, how can I create such text file. I have many thousands images. Should I do it manually, or is there any script that is doing that? Thanks in advance – S.EB Dec 27 '16 at 01:54

0 Answers0