How to use Bob's i-vectors functions in matlab environment?

26 views
Skip to first unread message

Jinfang Wang

unread,
Aug 11, 2017, 6:31:54 AM8/11/17
to bob-devel
Hi,

I would like to call the function extacting i-vectors implemented by Bob in matlab code environment because there are much work having been done with matlab program. I guess that there might be two ways,

1) In matlab environment, call Python Interpreter and 'import bob.bio.gmm' as well as related python codes. Maybe this can be regarded as 'matlab-python hybrid programming'. However, I amn't sure whether this is feasible.
2) In matlab environment, imbed 'verify.py ...' related command lines in the form of linux commands in matlab codes directly. I also can't be sure its availability.

My questions are,
1> Could you tell me whether two ways are available?
2> How to implement them with the concrete procedures?
3> If both of them are practicable, which is more efficient? Which one do you suggest me to choose?

Thank you for your warmhearted help.

Jinfang

Manuel Günther

unread,
Aug 11, 2017, 12:34:06 PM8/11/17
to bob-devel
Dear Jinfang,

I don't think that it is possible to call Python from within Matlab, but I am not a Matlab programmer. 
On the other hand, I know that there are some wrappers to call Matlab code from within Python, such as pymatlab. I have used this wrapper once to use Matlab code (that I got from someone else) inside my Python environment. Maybe you want to explore this option.

Anyways, even if there is a possibility to use Python from within Matlab, bob.bio.gmm might not be the best starting point. While bob.bio.gmm provides code to extract I-Vectors, it does so within the Biometrics framework. Maybe, it would be easier to interface with the toolbox, which implements I-Vectors directly, which would be bob.learn.em (AFAIK). You might want to have a look into the implementation inside bob.bio.gmm to see, which functions are called for I-Vector extraction.

If there is no direct interface between Matlab and Python, you are still not lost. You might perform the I-Vector extraction with Python, write the I-Vectors to an HDF5 file, and read HDF5 with Matlab.

Finally, the better option would be to drop Matlab and completely switch to Python. I am not sure if this is feasible, though.

Best regards
Manuel
Reply all
Reply to author
Forward
0 new messages