Blame view

egs/voxceleb/v1/local/prepare_for_eer.py 603 Bytes
8dcb6dfcb   Yannick Estève   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  #!/usr/bin/env python3
  #
  # Copyright 2015   David Snyder
  # Apache 2.0.
  #
  # Copied from egs/sre10/v1/local/prepare_for_eer.py (commit 9cb4c4c2fb0223ee90c38d98af11305074eb7ef8)
  #
  # Given a trials and scores file, this script
  # prepares input for the binary compute-eer.
  import sys
  trials = open(sys.argv[1], 'r').readlines()
  scores = open(sys.argv[2], 'r').readlines()
  spkrutt2target = {}
  for line in trials:
    spkr, utt, target = line.strip().split()
    spkrutt2target[spkr+utt]=target
  for line in scores:
    spkr, utt, score = line.strip().split()
    print("{} {}".format(score, spkrutt2target[spkr+utt]))