1

I am trying to use the following caffe model for prediction "https://github.com/amandajshao/www_deep_crowd". this model don't take as input an image but it takes some motion and appearance features. I have those features for every frame as .mat files and converted them to hdf5. but i couldn't figure out how to load them to caffe. any help please?

Shai
  • 111,146
  • 38
  • 238
  • 371

1 Answers1

0

Converting to HDF5 is more than half the way there...

"HDF5Data" layer can produce several "top"s: one for each dataset stored in the hdf5 file. So, suppose you used matlab to write your hdf5 files

hdf5write('my_data.h5', 'motion', single( motion )  );
hdf5write('my_data.h5', 'appearance', single(appearnace), 'WriteMode', 'append' );

Then you can have an "HDF5Data" layer with two "top"s:

layer {
  name: "data"
  type: "HDF5Data"
  top: "motion"
  top: "appearance"
  hdf5_data_param { source: "path/to/hdf_list.txt" }
}

You might want to pay close attention to the order the data is stored, as Matlab stores arrays in "Fortran" fashion, while caffe expects its data ordered in a "C" fashion. See this post for more information.

Community
  • 1
  • 1
Shai
  • 111,146
  • 38
  • 238
  • 371
  • thank you for reply. Actually, I am not trying to train a model. I need to use a pretrained caffe model to predict my own data. The authors of this pretrained model haven't provided the train_val.prototxt they provided only the deploy_prototxt. My issue is that the hdf5 files should be given as input for the prediction not the training. – Fatima-Zohra Daha Feb 13 '17 at 15:44