瀏覽代碼

update repo

嘉渊 2 年之前
父節點
當前提交
5bc41aad67
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      tests/test_sv_inference_pipeline.py

+ 2 - 1
tests/test_sv_inference_pipeline.py

@@ -37,12 +37,13 @@ class TestXVectorInferencePipelines(unittest.TestCase):
         same_cos = np.sum(enroll * same) / (np.linalg.norm(enroll) * np.linalg.norm(same))
         same_cos = np.sum(enroll * same) / (np.linalg.norm(enroll) * np.linalg.norm(same))
         same_cos = max(same_cos - sv_threshold, 0.0) / (1.0 - sv_threshold) * 100.0
         same_cos = max(same_cos - sv_threshold, 0.0) / (1.0 - sv_threshold) * 100.0
         logger.info("Similarity: {}".format(same_cos))
         logger.info("Similarity: {}".format(same_cos))
+        assert int(same_cos) == 85
 
 
         # 对不同的说话人计算余弦相似度
         # 对不同的说话人计算余弦相似度
         diff_cos = np.sum(enroll * different) / (np.linalg.norm(enroll) * np.linalg.norm(different))
         diff_cos = np.sum(enroll * different) / (np.linalg.norm(enroll) * np.linalg.norm(different))
         diff_cos = max(diff_cos - sv_threshold, 0.0) / (1.0 - sv_threshold) * 100.0
         diff_cos = max(diff_cos - sv_threshold, 0.0) / (1.0 - sv_threshold) * 100.0
         logger.info("Similarity: {}".format(diff_cos))
         logger.info("Similarity: {}".format(diff_cos))
-
+        assert int(diff_cos) == 0.0
 
 
 if __name__ == '__main__':
 if __name__ == '__main__':
     unittest.main()
     unittest.main()