ProgramComputer commited on
Commit
7e25ca4
·
1 Parent(s): 97aa253

Update test.py

Browse files
Files changed (1) hide show
  1. test.py +26 -25
test.py CHANGED
@@ -299,28 +299,29 @@ class VoxCeleb(datasets.GeneratorBasedBuilder):
299
  index_col=0,
300
  engine="python",
301
  )
302
- dataset_path = next(Path(paths[conf]).iterdir())
303
- dataset_format = dataset_path.name
304
- for speaker_path in dataset_path.iterdir():
305
- speaker = speaker_path.name
306
- speaker_info = meta.loc[speaker]
307
- for video in speaker_path.iterdir():
308
- video_id = video.name
309
- for clip in video.iterdir():
310
- clip_index = int(clip.stem)
311
- info = {
312
- "file": str(clip),
313
- "file_format": dataset_format,
314
- "dataset_id": dataset_id,
315
- "speaker_id": speaker,
316
- "speaker_gender": speaker_info["Gender"],
317
- "video_id": video_id,
318
- "clip_index": clip_index,
319
- }
320
- if dataset_id == "vox1":
321
- info["speaker_name"] = speaker_info["VGGFace1 ID"]
322
- info["speaker_nationality"] = speaker_info["Nationality"]
323
- if conf.startswith("audio"):
324
- info["audio"] = info["file"]
325
- yield key, info
326
- key += 1
 
 
299
  index_col=0,
300
  engine="python",
301
  )
302
+ for path in paths[conf]:
303
+ dataset_path = next(Path(path).iterdir())
304
+ dataset_format = dataset_path.name
305
+ for speaker_path in dataset_path.iterdir():
306
+ speaker = speaker_path.name
307
+ speaker_info = meta.loc[speaker]
308
+ for video in speaker_path.iterdir():
309
+ video_id = video.name
310
+ for clip in video.iterdir():
311
+ clip_index = int(clip.stem)
312
+ info = {
313
+ "file": str(clip),
314
+ "file_format": dataset_format,
315
+ "dataset_id": dataset_id,
316
+ "speaker_id": speaker,
317
+ "speaker_gender": speaker_info["Gender"],
318
+ "video_id": video_id,
319
+ "clip_index": clip_index,
320
+ }
321
+ if dataset_id == "vox1":
322
+ info["speaker_name"] = speaker_info["VGGFace1 ID"]
323
+ info["speaker_nationality"] = speaker_info["Nationality"]
324
+ if conf.startswith("audio"):
325
+ info["audio"] = info["file"]
326
+ yield key, info
327
+ key += 1