rhgao/Deep-MIML-Network

Sry but How to get the correctly formatted hdf5 file from the downloaded dataset?

Closed this issue · 7 comments

Sorry for a silly question.

I found that your code reads a hdf5 file as a input, but there're only many frames and audios in your public dataset. Since hdf5 file contains lots of formatted data structures, I think there must be some scripts to convert the dataset folder to the target hdf5 file for further training. However, I could not find such file, and also cannot figure out how to get that correct hdf5 file. May I ask that what should I do in order to get the correct file?

Thanks !

Well, where can I find the dataset? or is it not supposed to provide the dataset? Thanks.

rhgao commented

The dataset used is AudioSet (https://research.google.com/audioset/ontology/index.html), and you could choose the classes that you want to use and download the corresponding video clips. The categories used in the paper are listed in Supp.

rhgao commented

To generate hdf5 file, you could use scripts similar to below:
import h5py
h5f = h5py.File('train.h5', 'w')
h5f.create_dataset('bases', data=bases[0:numOfTrain])
h5f.create_dataset('labels', data=labels[0:numOfTrain])
h5f.close()

"bases" is a numpy array that stores the bases extracted from NMF, and "labels" stores the labels predicted from visual classifier or ground-truth labels. A good NMF implementation is: http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.NMF.html

To generate hdf5 file, you could use scripts similar to below:
import h5py
h5f = h5py.File('train.h5', 'w')
h5f.create_dataset('bases', data=bases[0:numOfTrain])
h5f.create_dataset('labels', data=labels[0:numOfTrain])
h5f.close()

"bases" is a numpy array that stores the bases extracted from NMF, and "labels" stores the labels predicted from visual classifier or ground-truth labels. A good NMF implementation is: http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.NMF.html

Thanks for the information! You have done great work!

To generate hdf5 file, you could use scripts similar to below:
import h5py
h5f = h5py.File('train.h5', 'w')
h5f.create_dataset('bases', data=bases[0:numOfTrain])
h5f.create_dataset('labels', data=labels[0:numOfTrain])
h5f.close()

"bases" is a numpy array that stores the bases extracted from NMF, and "labels" stores the labels predicted from visual classifier or ground-truth labels. A good NMF implementation is: http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.NMF.html

Sorry for disturbing again, should it be:
bases array shaped [numOfTrain, M (#basis vectors), vector_dim (of basis vector)], and
labels array shaped [numOfTrain, label_dim] ?

rhgao commented

In my case, bases is just a list of the paths that stores the actual bases, and labels are the corresponding label indexes in the same order. Then I load the bases in the data loader through the corresponding path.

Thank you very much for those information! (Sorry for the late reply.)