1

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?

Screenshot of my levelDB output

Shai
  • 111,146
  • 38
  • 238
  • 371

2 Answers2

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
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