caffe icon indicating copy to clipboard operation
caffe copied to clipboard

how to load a directory including many images?

Open liuyudut opened this issue 12 years ago • 1 comments

(1)as I know, the ' caffe.io.load_image(IMAGE_FILE)' can only load one image. what if there are many images in the directory? how to load them together? (2)what I do is just to extract the features, but use '/build/tools/extract_features.bin' outputs the leveldb file. I want to save the features in ascii files which can be watched. what can i do to convert the leveldb?

liuyudut avatar Oct 23 '14 12:10 liuyudut

  1. Load several images in a list comprehension then call Net.forward() or Classifier.predict() on all of them at once.
  2. It's easiest to extract features in Python through the Net.data dictionary interface. Net.data['fc7'].data of CaffeNet for instance is the ndarray of the fc7 feature for the input batch (the first dimension is the batch index, so the first input's fc7 would be index 0).

shelhamer avatar Nov 30 '14 22:11 shelhamer