Nevertheless, I'm not marking this as complete because I'm hoping there is a cleaner method to do this.
Basically, my solution is a script that calls the 'extract_features.bin' several times. Note that I do that through system calls (I'm sorry!).
I did this because 'extract_features.bin' batches at most 500 images at a time, as I verified with experiments and as mentioned at another thread. Regardless of how many images we list at 'file_list.txt'.
After each batch, the script load the features from the output leveldb
At the end it saves all the features as a numpy array. I think this should be faster than extracting features of one image at a time as showed at the feature extraction notebook. The ugliest part of it is that it should be loading the model to memory every time we call it...
But, while we wait for something better, here is a sample usage:
let your *.jpg images be at ./data:
$ python caffe_features.py ./data ./results [-d GPU|CPU] [-f jpg]
you can also import caffe_features at a python section and use the extract method F = caffe_features.extract('./data')
*Note that your edited 'imagenet_val.prototxt' should be on the same folder as caffe_features.py
**The only prereq (besides what we usually have) is the natsort module (it is easy to pip install, though).