caffe icon indicating copy to clipboard operation
caffe copied to clipboard

Online Feature Extraction with C++

Open shethsh opened this issue 10 years ago • 2 comments

I am looking for an example where we can extract features from a Caffe model for new images getting generated in C++ The current way that I saw of using extract_features.bin is time-consuming since it needs to read the model in real-time froim disk. Any example where we can read the model once, cache it and as soon as a new image arrives, extract features from it in C++ will be helpful

shethsh avatar Apr 12 '16 11:04 shethsh

See https://github.com/beniz/deepdetect/blob/master/src/caffelib.cc#L1838 it extracts any requested layer out of a pre-loaded model, and outputs the layer values, possibly in batch. You'd need to replace it into pure Caffe context, but the core of what you appear to be looking for is there.

beniz avatar Apr 13 '16 12:04 beniz

Additionally, https://github.com/facebook/fb-caffe-exts/ also has a helper library that we use at Facebook. Hope these examples help. Thanks!

ajtulloch avatar Apr 15 '16 21:04 ajtulloch