CSV files as an input to BOB

15 views
Skip to first unread message

nora

unread,
Feb 12, 2018, 6:50:07 PM2/12/18
to bob-devel
Good afternoon:

I was able to run the experiments for face and speaker recognition ,the experiments are very good and useful,Now I wish to use my own data base for (gait recognition) with BOB ,my data base is .CSV  file and have lots of numbers,would I be able to use (input) my data to  BOB and get it to work ?Please let me know.I appreciate your help.

nora

unread,
Feb 12, 2018, 7:01:11 PM2/12/18
to bob-devel


On Monday, February 12, 2018 at 4:50:07 PM UTC-7, nora wrote:
Good afternoon:

I was able to run the experiments for face and speaker recognition ,the experiments are very good and useful,Now I wish to use my own data base for (gait recognition) with BOB ,my data base is .CSV  file and have lots of numbers,would I be able to use (input) my data to  BOB and get it to work ?Please let me know.I appreciate your help.

I have attached an example of my .csv file .
Thanks alot
Geometric_Positions.csv

Manuel Günther

unread,
Feb 12, 2018, 7:15:00 PM2/12/18
to bob-devel
Dear Nora,

this is definitely possible, I have implemented something similar before. However, there is no out-of-the-box solution, you would need to implement your tool (Preprocessor, Extractor) on your own.

First, you would need to implement an interface for your database, i.e., define which elements to use for training (if any), for enrollment and for probing. We have a custom filelist database interface for this purpose: https://www.idiap.ch/software/bob/docs/bob/bob.bio.base/stable/filelist-guide.html

Then, you can attempt to implement the CSV list is to have a Preprocessor that contains a function to read the data and store it in a dictionary structure. The keys to that dictionary must comply with the file names that you have put in your database interface, and usually they should correspond to the keys stored in your CSV file (this makes it very easy).
You need to implement the read_original_data function of your preprocessor to basically forward the file name to your __call__ function. In the __call__ function of your preprocessor, simply return the value that is stored in the dictionary that you have loaded before.

To avoid to load the dictionary when it is not needed, you can call the function to read your data whenever you first need it. You can try something like:

class Preprocessor (bob.bio.base.preprocessor.Preprocessor):


 
def __init__(self, CSV_file):
   
self.csv_file = csv_file
   
self.data_dictionary= None

 
def read_csv_file(self):
   
if self.data_dictionary is None:
     
self.data_dictionary =... (read the data)

 
def __call__(self, key, annotations=None):
   
self.read_csv_file()
   
return self.data_dictionary[key]

 
def read_original_data(self, bio_file, directory, extension):
   
return bio_file.make_path()

I have not tested that code, so it might not work exactly like that, but this should point to the direction, how it might work.

I hope this helps
Manuel

Manuel Günther

unread,
Feb 12, 2018, 7:17:54 PM2/12/18
to bob-devel
Nora,

This file is not very good, because it does not tell, which features belong to which file. You should try to get the filename (or some other identifier) into the file. You will need that identifier to generate your database interface, and to use it as the key for the dictionary (see my previous post).

Manuel
Reply all
Reply to author
Forward
0 new messages