ProgramComputer commited on
Commit
337baec
·
1 Parent(s): 3a5599f

Update test.py

Browse files
Files changed (1) hide show
  1. test.py +23 -23
test.py CHANGED
@@ -308,26 +308,26 @@ class VoxCeleb(datasets.GeneratorBasedBuilder):
308
  # raise Exception(find_mount_point(path))
309
  #subdirs = [x[0] for x in os.walk(path)]
310
  #raise Exception(subdirs)
311
-
312
-
313
- #raise Exception(os.is_symlink(path))
314
- #raise Exception(os.listdir(path))
315
- dataset_format,speaker,video_id,clip_index= path.split("::")[0].split("/")[2:]
316
- speaker_info = meta.loc[speaker]
317
- clip_index = int(Path(clip_index).stem)
318
- info = {
319
- "file": str(path),
320
- "file_format": dataset_format,
321
- "dataset_id": dataset_id,
322
- "speaker_id": speaker,
323
- "speaker_gender": speaker_info["Gender"],
324
- "video_id": video_id,
325
- "clip_index": clip_index,
326
- }
327
- if dataset_id == "vox1":
328
- info["speaker_name"] = speaker_info["VGGFace1 ID"]
329
- info["speaker_nationality"] = speaker_info["Nationality"]
330
- if conf.startswith("audio"):
331
- info["audio"] = info["file"]
332
- yield key, info
333
- key += 1
 
308
  # raise Exception(find_mount_point(path))
309
  #subdirs = [x[0] for x in os.walk(path)]
310
  #raise Exception(subdirs)
311
+ for file in path:
312
+
313
+ #raise Exception(os.is_symlink(path))
314
+ #raise Exception(os.listdir(path))
315
+ dataset_format,speaker,video_id,clip_index= file.split("::")[0].split("/")[2:]
316
+ speaker_info = meta.loc[speaker]
317
+ clip_index = int(Path(clip_index).stem)
318
+ info = {
319
+ "file": str(file),
320
+ "file_format": dataset_format,
321
+ "dataset_id": dataset_id,
322
+ "speaker_id": speaker,
323
+ "speaker_gender": speaker_info["Gender"],
324
+ "video_id": video_id,
325
+ "clip_index": clip_index,
326
+ }
327
+ if dataset_id == "vox1":
328
+ info["speaker_name"] = speaker_info["VGGFace1 ID"]
329
+ info["speaker_nationality"] = speaker_info["Nationality"]
330
+ if conf.startswith("audio"):
331
+ info["audio"] = info["file"]
332
+ yield key, info
333
+ key += 1