Reputation: 35
I am working on Caffe. I already extract features using extract_features.bin
, it will create a result as this figure below. It said that the feature will stored in LevelDB format. But, since I almost work in MATLAB, so I want to read this output on my MATLAB. But, I still cannot find a way how to do that. Anybody could help me?
Upvotes: 1
Views: 721
Reputation: 114866
Alternatively, you can use python to read the leveldb, save it to mat-file and process it in Matlab.
For this workaround to work, you'll need py-leveldb
(and python...)
In python
import leveldb # for reading leveldb
import numpy as np # for manipulating the data
import scipy.io # for writing to mat file
data = []
db = leveldb.LevelDB('/path/to/output400_flickr_fc7')
for key, value in db.RangeIter():
data.append( np.array(value) )
scipy.io.savemat('/path/to/output400_flickr_fc7.mat', {'data': np.hstack(data)})
Now you should be able to load in Matlab (should be stored to data
variable)
>> load('/path/to/output400_flickr_fc7.mat');
Upvotes: 3