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?
Asked
Active
Viewed 664 times
1

Shai
- 111,146
- 38
- 238
- 371

nafilatur2724
- 35
- 2
2 Answers
2
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');

Shai
- 111,146
- 38
- 238
- 371
-
Thank you @Shai, I will try this – nafilatur2724 Aug 10 '16 at 11:55
1
Have you looked at this git project?
This project seems to implement a wrapper for reading leveldb datasets into matlab.

Shai
- 111,146
- 38
- 238
- 371
-
-
1thats project is designed for UNIX. But, now i am working on windows. So do you have any recommendation? – nafilatur2724 Aug 10 '16 at 07:00
-
the data is read from leveldb as string, how would you convert it to image? – dolbi Sep 11 '16 at 08:40