"git@developer.sourcefind.cn:OpenDAS/pytorch3d.git" did not exist on "83feed56a0c25a8e82dbe3a64f50b5f7dcbad0ff"
Unverified Commit eb5b5a02 authored by Tomás Osório's avatar Tomás Osório Committed by GitHub
Browse files

[BC breaking] fix issue with VCTK dataset (#484)



* fix issue with VCTK dataset

* update docstring

* filter out folder p315

* add hidden except_folder has hidden variable

* maintain structure

* lint

* remove space
Co-authored-by: default avatarVincent QB <vincentqb@users.noreply.github.com>
parent e9f8ba9d
...@@ -244,9 +244,9 @@ def walk_files(root, suffix, prefix=False, remove_suffix=False): ...@@ -244,9 +244,9 @@ def walk_files(root, suffix, prefix=False, remove_suffix=False):
suffix (str or tuple): Suffix of the files to match, e.g. '.png' or ('.jpg', '.png'). suffix (str or tuple): Suffix of the files to match, e.g. '.png' or ('.jpg', '.png').
It uses the Python "str.endswith" method and is passed directly It uses the Python "str.endswith" method and is passed directly
prefix (bool, optional): If true, prepends the full path to each result, otherwise prefix (bool, optional): If true, prepends the full path to each result, otherwise
only returns the name of the files found only returns the name of the files found (Default: ``False``)
remove_suffix (bool, optional): If true, removes the suffix to each result defined in suffix, remove_suffix (bool, optional): If true, removes the suffix to each result defined in suffix,
otherwise will return the result as found. otherwise will return the result as found (Default: ``False``).
""" """
root = os.path.expanduser(root) root = os.path.expanduser(root)
......
...@@ -39,12 +39,16 @@ class VCTK(Dataset): ...@@ -39,12 +39,16 @@ class VCTK(Dataset):
""" """
Create a Dataset for VCTK. Each item is a tuple of the form: Create a Dataset for VCTK. Each item is a tuple of the form:
(waveform, sample_rate, utterance, speaker_id, utterance_id) (waveform, sample_rate, utterance, speaker_id, utterance_id)
Folder `p315` will be ignored due to the non-existent corresponding text files.
For more information about the dataset visit: https://datashare.is.ed.ac.uk/handle/10283/3443
""" """
_folder_txt = "txt" _folder_txt = "txt"
_folder_audio = "wav48" _folder_audio = "wav48"
_ext_txt = ".txt" _ext_txt = ".txt"
_ext_audio = ".wav" _ext_audio = ".wav"
_except_folder = "p315"
def __init__( def __init__(
self, self,
...@@ -93,6 +97,7 @@ class VCTK(Dataset): ...@@ -93,6 +97,7 @@ class VCTK(Dataset):
walker = walk_files( walker = walk_files(
self._path, suffix=self._ext_audio, prefix=False, remove_suffix=True self._path, suffix=self._ext_audio, prefix=False, remove_suffix=True
) )
walker = filter(lambda w: self._except_folder not in w, walker)
self._walker = list(walker) self._walker = list(walker)
def __getitem__(self, n): def __getitem__(self, n):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment