sidekit_io

Copyright 2014-2019 Anthony Larcher

sidekit_io provides methods to read and write from and to different formats.

sidekit_io.h5merge(output_filename, input_filename_list)[source]

Merge a list of HDF5 files into a new one.

Parameters
  • output_filename – the name of the new file resulting from the merge.

  • input_filename_list – list of thge input files

sidekit_io.init_logging(level=20, filename=None)[source]

Initialize a logger

Parameters
  • level – level of messages to catch

  • filename – name of the output file

sidekit_io.read_dict_hdf5(input_filename)[source]

Read a dictionary from an HDF5 file.

Parameters

input_filename – name of the file to read from

Returns

the dictionary

sidekit_io.read_fa_hdf5(input_filename)[source]

Read a generic FA model from a HDF5 file

Parameters

input_filename – the name of the file to read from

Returns

a tuple of 5 elements: the mean vector, the between class covariance matrix, the within class covariance matrix, the MAP matrix and the residual covariancematrix

sidekit_io.read_key_hdf5(input_filename, key)[source]

Read key value from a HDF5 file.

Parameters
  • input_filename – the name of the file to read from

  • key – the name of the key

Returns

a value

sidekit_io.read_matrix(filename)[source]

Read matrix in ALIZE binary format and return a ndarray

Parameters

filename – name of the file to read from

Returns

a numpy.ndarray object

sidekit_io.read_norm_hdf5(input_filename)[source]

Read normalization parameters from a HDF5 file.

Parameters

input_filename – the name of the file to read from

Returns

a tuple of two lists. The first list contains mean vectors for each iteration, the second list contains covariance matrices for each iteration

sidekit_io.read_pickle(filename)[source]

Read a generic pickle file and return the content

Parameters

filename – name of the pickle file to read

Returns

the content of the file

sidekit_io.read_plda_hdf5(input_filename)[source]

Read a PLDA model from a HDF5 file.

Parameters

input_filename – the name of the file to read from

Returns

a tuple of 4 elements: the mean vector, the between class covariance matrix, the within class covariance matrix and the residual matrix

sidekit_io.read_tv_hdf5(input_filename)[source]

Read the TotalVariability matrix, the mean and the residual covariance from a HDF5 file.

Parameters

input_filename – name of the file to read from

Returns

a tuple of three elements: the matrix, the mean vector and the inverse covariance vector

sidekit_io.read_vect(filename)[source]

Read vector in ALIZE binary format and return an array

Parameters

filename – name of the file to read from

Returns

a numpy.ndarray object