voxseg_/extract_feats.py
def prep_data(data_dir: str, params,  mode: str="train"):
    '''Function for creating pd.DataFrame containing dataset information specified by Kaldi-style
    data directory.

    Args:
        data_dir: The path to the data directory.
        params: processing parameters (winlen, winstep, ...)
        mode: train/valid/test

    Returns:
        A pd.DataFrame of dataset information. For example:

            recording-id  extended filename        utterance-id  start  end  signal
        0   rec_00        ~/Documents/test_00.wav  utt_00        10     20   [-49, -43, -35...
        1   rec_00        ~/Documents/test_00.wav  utt_01        50     60   [-35, -23, -12...
        2   rec_01        ~/Documents/test_01.wav  utt_02        135    163  [25, 32, 54...

        Note that 'utterance-id', 'start' and 'end' are optional, will only appear if data directory
        contains 'segments' file.
    '''

    wav_scp, segments, _  = utils.process_data_dir(data_dir, params)

    # check for segments file and process if found
    if (segments is None) or (mode == "test"):
        print('WARNING: Segments file not found, entire audio files will be processed.')
        (rate, pd_data) = utils.read_sigs(wav_scp)
        wav_scp = wav_scp.merge(pd_data)
        return (rate, wav_scp)
    else:
        data = wav_scp.merge(segments)
        (rate, pd_data) = utils.read_sigs(data)
        data = data.merge(pd_data)
        return (rate, data)
Function for creating pd.DataFrame containing dataset information specified by Kaldi-style
    data directory.

    Args:
        data_dir: The path to the data directory.
        params: processing parameters (winlen, winstep, ...)
        mode: train/valid/test

    Returns:
        A pd.DataFrame of dataset information. For example:

            recording-id  extended filename        utterance-id  start  end  signal
        0   rec_00        ~/Documents/test_00.wav  utt_00        10     20   [-49, -43, -35...
        1   rec_00        ~/Documents/test_00.wav  utt_01        50     60   [-35, -23, -12...
        2   rec_01        ~/Documents/test_01.wav  utt_02        135    163  [25, 32, 54...

        Note that 'utterance-id', 'start' and 'end' are optional, will only appear if data directory
        contains 'segments' file.
    
Function for creating pd.DataFrame containing dataset information specified by Kaldi-style
data directory.
Function for creating pd . DataFrame containing dataset information specified by Kaldi - style data directory .
def prep_data(data_dir: str, params,  mode: str="train"):
    wav_scp, segments, _  = utils.process_data_dir(data_dir, params)
    if (segments is None) or (mode == "test"):
        print('WARNING: Segments file not found, entire audio files will be processed.')
        (rate, pd_data) = utils.read_sigs(wav_scp)
        wav_scp = wav_scp.merge(pd_data)
        return (rate, wav_scp)
    else:
        data = wav_scp.merge(segments)
        (rate, pd_data) = utils.read_sigs(data)
        data = data.merge(pd_data)
        return (rate, data)
def prep_data ( data_dir : str , params , mode : str = "train" ) : wav_scp , segments , _ = utils . process_data_dir ( data_dir , params ) if ( segments is None ) or ( mode == "test" ) : print ( 'WARNING: Segments file not found, entire audio files will be processed.' ) ( rate , pd_data ) = utils . read_sigs ( wav_scp ) wav_scp = wav_scp . merge ( pd_data ) return ( rate , wav_scp ) else : data = wav_scp . merge ( segments ) ( rate , pd_data ) = utils . read_sigs ( data ) data = data . merge ( pd_data ) return ( rate , data )
Function for creating pd.DataFrame containing dataset information specified by Kaldi-style
data directory.
Function for creating pd . DataFrame containing dataset information specified by Kaldi - style data directory .
'''Function for creating pd.DataFrame containing dataset information specified by Kaldi-style
    data directory.

    Args:
        data_dir: The path to the data directory.
        params: processing parameters (winlen, winstep, ...)
        mode: train/valid/test

    Returns:
        A pd.DataFrame of dataset information. For example:

            recording-id  extended filename        utterance-id  start  end  signal
        0   rec_00        ~/Documents/test_00.wav  utt_00        10     20   [-49, -43, -35...
        1   rec_00        ~/Documents/test_00.wav  utt_01        50     60   [-35, -23, -12...
        2   rec_01        ~/Documents/test_01.wav  utt_02        135    163  [25, 32, 54...

        Note that 'utterance-id', 'start' and 'end' are optional, will only appear if data directory
        contains 'segments' file.
    ''' # check for segments file and process if found
A pd.DataFrame of dataset information. For example.



Note that 'utterance-id', 'start' and 'end' are optional, will only appear if data directory
contains 'segments' file.
A pd . DataFrame of dataset information . For example . Note that ' utterance - id ' ' start ' and ' end ' are optional will only appear if data directory contains ' segments ' file .
data_dir
str
The path to the data directory.
The path to the data directory .
params
processing parameters (winlen, winstep, ...)
processing parameters ( winlen winstep ... )
mode
str
None