data_len_generator
get_data_length(idx2data)
Calculate the length of each feature in the given chunk of idx2data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
idx2data
|
List[List[str]]
|
A list of [idx, data_path] pairs. |
required |
Returns:
| Type | Description |
|---|---|
|
List[List[str]]: A list of [idx, data_length] pairs. |
Source code in speechain/datasets/pyscripts/data_len_generator.py
main(src_file, ncpu=8)
Main function that extracts feature lengths and saves them to file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
src_file
|
str
|
The absolute path of the input 'idx2wav' or 'idx2feat' file. |
required |
ncpu
|
int
|
The number of processes to use for the calculation. |
8
|
Source code in speechain/datasets/pyscripts/data_len_generator.py
parse()
Parse command line arguments using argparse.
Returns:
| Type | Description |
|---|---|
|
argparse.Namespace: Parsed arguments as a namespace object. |