Blame view

egs/wsj/s5/steps/nnet2/check_ivectors_compatible.sh 1.27 KB
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
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  #!/bin/bash
  # Copyright (c) 2016, Johns Hopkins University (Yenda Trmal <jtrmal@gmail.com>)
  # License: Apache 2.0
  
  # Begin configuration section.
  # End configuration section
  
  #echo >&2 "$0 $@"  # Print the command line for logging
  if [ $# != 2 ] ; then
    echo >&2 "Usage: $0  <first-dir> <second-dir>"
    echo >&2 " e.g.: $0 exp/nnet3/extractor exp/nnet3/ivectors_dev10h.pem"
  fi
  
  dir_a=$1
  dir_b=$2
  
  id_a=$(steps/nnet2/get_ivector_id.sh $dir_a)
  ret_a=$?
  id_b=$(steps/nnet2/get_ivector_id.sh $dir_b)
  ret_b=$?
  
  if [ ! -z "$id_a" ] && [ ! -z "${id_b}" ] ; then
    if [ "${id_a}" == "${id_b}" ]; then
      exit 0
    else
      echo >&2 "$0: ERROR: iVector id ${id_a} in $dir_a and the iVector id ${id_b} in $dir_b do not match"
      echo >&2 "$0: ERROR: that means that the systems are not compatible."
      exit 1
    fi
  elif [ -z "$id_a" ] && [ -z "${id_b}" ] ; then
      echo >&2 "$0: WARNING: The directories do not contain iVector ID."
      echo >&2 "$0: WARNING: That means it's you who's reponsible for keeping "
      echo >&2 "$0: WARNING: the directories compatible"
      exit 0
  else
      echo >&2 "$0: WARNING: One of the directories do not contain iVector ID."
      echo >&2 "$0: WARNING: That means it's you who's reponsible for keeping "
      echo >&2 "$0: WARNING: the directories compatible"
      exit 0
  fi