caffe
caffe copied to clipboard
how to load a directory including many images?
(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?
- Load several images in a list comprehension then call
Net.forward()orClassifier.predict()on all of them at once. - It's easiest to extract features in Python through the
Net.datadictionary interface.Net.data['fc7'].dataof 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).