Skip to content

Conversation

FlorisGaisser
Copy link

Changed the ImageDataLayer to have more than 1 image output.
By adding more 'top' params in the data layer in the .prototxt file while keeping the label last, more images can be loaded.
This can be used to load for example siamese image pairs from a textfile as created by 'create_imageset' in 'examples/siamese/'.

The test for the ImageDataLayer has been extended to include multiple inputs to test. Therefore 3 images have been added to the 'examples/images/' folder.

It has to be noted that since this required changes in the BasePrefetchingDataLayer and also other
classes are inherited from it, for now a new class: BasePrefetchingMulitDataLayer has been made.
After thorough testing, this code can be moved into the BasePrefetchingDataLayer class as it should be compatable.

P.S. This replaces #2608 which contained commits from unrelated work.

By adding more 'top' params in the data layer in the .prototxt file while
keeping the label last, more images can be loaded.
This can be used to load for example siamese image pairs from a textfile as
created by 'create_imageset' in 'examples/siamese/'.

Since this required changes in the BasePrefetchingDataLayer and also other
classes are inherited from it, for now a new class:
BasePrefetchingMulitDataLayer has been made.
After thorough testing, this code can be moved into the original class as it
still supports loading only a single entity of data.
@mtmarsh2
Copy link

Is this just for grayscale images with 1 channel or can it be used for 3 channel images?

@FlorisGaisser
Copy link
Author

I haven't tested it, but I think it should work with colour images too.
Could you test it and message me again? If it's not working, I'll try to make it work with colour images from Tuesday, but atm I don't have excess to my pc.

@bhack
Copy link
Contributor

bhack commented Jul 19, 2015

/cc @mtamburrano @wangyida

@mtmarsh2
Copy link

Hmm not sure if its related to the color channel, but I'm getting the following error when I run the "examples/siamese/create_siamese_from_imageset.sh" script. I have two folder: train_images and test_images, and each have the siamese_set.txt inside. I also checked the paths, and both files exist on disk

ERROR! one or both input images are empty:
1: examples/101/Motorbikes/image_0344.jpg is empty: 0
2: examples/101/Leopards/image_0178.jpg is empty: 0

@FlorisGaisser
Copy link
Author

This error means that loading of the image failed (there are different reasons to this). But this probably means the path is incorrect. I think you didn't define a root_folder param. Try defining this param from root: /path/to/caffe/ and probably it would work.

-------- Original message --------
From: Michael Marshall [email protected]
Date:20/07/2015 04:25 (GMT+01:00)
To: BVLC/caffe [email protected]
Cc: Floris Gaisser [email protected]
Subject: Re: [caffe] Feature layer image data load set (#2613)

Hmm not sure if its related to the color channel, but I'm getting the following error when I run the "examples/siamese/create_siamese_from_imageset.sh" script. I have two folder: train_images and test_images, and each have the siamese_set.txt inside. I also checked the paths, and both files exist on disk

ERROR! one or both input images are empty:
1: examples/101/Motorbikes/image_0344.jpg is empty: 0
2: examples/101/Leopards/image_0178.jpg is empty: 0


Reply to this email directly or view it on GitHub.

@nassarofficial
Copy link

I see that in the files changed that there are RGB images, is it working with RGB?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants