Permalink
Browse files

Revert "Update tests to use numpy.testing"

This reverts commit 882109c.
  • Loading branch information...
1 parent 882109c commit 4d0280557cec3e1f52b72479d40aaf275d77ffc3 @bamos bamos committed Oct 16, 2016
Showing with 3 additions and 4 deletions.
  1. +2 −2 tests/openface_api_tests.py
  2. +1 −2 tests/openface_batch_represent_tests.py
@@ -19,7 +19,6 @@
import os
import numpy as np
-import numpy.testing as npt
np.set_printoptions(precision=2)
import scipy
@@ -64,4 +63,5 @@ def test_pipeline():
rep = net.forward(alignedFace)
cosDist = scipy.spatial.distance.cosine(rep, np.ones(128))
- npt.assert_almost_equal(cosDist, 0.938840385931)
+ print(cosDist)
+ assert np.isclose(cosDist, 0.938840385931)
@@ -20,7 +20,6 @@
import tempfile
import numpy as np
-import numpy.testing as npt
np.set_printoptions(precision=2)
import pandas as pd
import scipy
@@ -87,6 +86,6 @@ def test_batch_represent():
cosDist = scipy.spatial.distance.cosine(brody1, brody2)
print('cosDist:', cosDist)
- npt.assert_almost_equal(cosDist, 0.1568, decimal=4)
+ assert np.isclose(cosDist, 0.1568, atol=1e-4)
shutil.rmtree(workDir)

0 comments on commit 4d02805

Please sign in to comment.