Creating lmdb for groundtruth labels.

1,295 views
Skip to first unread message

Clint Sebastian

unread,
May 13, 2016, 4:02:37 AM5/13/16
to Caffe Users
Hi all,

I'm trying to make a mdb file using convert_imageset. For image in --> image out tasks, I am following https://github.com/BVLC/caffe/issues/1013
Apparently I need to create two data layers to do that.

My question is when I define the image files in the train.txt (which is used for creating mdb), it has two components.

The file name and the label. So the .txt file looks like this.

/something/image.jpg 1

In this case, should I leave the label blank? Like this?

/something/image.jpg
  

Ma'mur Abdullayev

unread,
May 13, 2016, 4:16:16 AM5/13/16
to Caffe Users
In here Dennis Chen explained how to create lmdb data step by step. Follow the steps https://github.com/BVLC/caffe/issues/550

пятница, 13 мая 2016 г., 17:02:37 UTC+9 пользователь Clint Sebastian написал:

Clint Sebastian

unread,
May 13, 2016, 5:00:03 AM5/13/16
to Caffe Users
Hi,

Thank you for the answer but that is for classification task involving only a single label but mine involves pixel-wise prediction. 
I am currently able to create mdb files for classification task which has only a single label.
This involves just writing the image name and its corresponding label in the txt file.

But in this case, I am creating two mdb files one for input data and other for groundtruth (image file).

In each of the mdb files I create, I need to define a txt file which again has a label (0,1...etc) which is irrelevant in my task.

I am not sure if I should include a label value in the txt file.

Jan

unread,
May 13, 2016, 5:03:44 AM5/13/16
to Caffe Users
Not sure if it works when you leave it blank, but it doesn't really matter what you put there for your task. You could just put zero in every line for instance.

https://github.com/BVLC/caffe/blob/master/tools/convert_imageset.cpp#L74-L80 suggests that the label is needed (although you maybe don't use later). It is the same with an ImageData layer.

Jan

Clint Sebastian

unread,
May 13, 2016, 5:16:46 AM5/13/16
to Caffe Users
Yes, as you said I think it won't work if I leave it blank.
So a dummy value 1 for both database files should work

/image1.jpg 1
/image2.jpg 1
.
.
.
.

Thank you.

Anne

unread,
Jun 10, 2016, 3:55:16 AM6/10/16
to Caffe Users
Hi,
Did you succeed in creating your 2 datasets (images & groundtruth) by puting a random label in the .txt file?
Thank you

Clint Sebastian

unread,
Jun 10, 2016, 5:06:20 AM6/10/16
to Caffe Users
Hi,

Yes. I was able to put in a random number and perform regression.
It works because the number labels in the .txt are not loaded in the data layer. 


Anne

unread,
Jun 13, 2016, 5:33:32 AM6/13/16
to Caffe Users
Thank you for your answer, but now that I've succeeded in creating the dataset, I'm wondering how I can associate each image with its groundtruth and train my model ? I hope it's clear
Thanks in advance

Clint Sebastian

unread,
Jun 13, 2016, 6:37:15 AM6/13/16
to Caffe Users
Hi,

Make sure that both the input and the groundtruth are in the same order. This automatically associates each image with the groundtruth.

Kind regards,
Clint 
Reply all
Reply to author
Forward
0 new messages