mirror of
https://github.com/serengil/deepface.git
synced 2025-06-07 12:05:22 +00:00
[fix] avoid problem of precision in float
This commit is contained in:
parent
4d7793169b
commit
0ab3ac2d51
@ -171,8 +171,9 @@ def test_batch_detect_age_for_multiple_faces():
|
|||||||
results = Age.ApparentAgeClient().predict(imgs)
|
results = Age.ApparentAgeClient().predict(imgs)
|
||||||
# Check there are two ages detected
|
# Check there are two ages detected
|
||||||
assert len(results) == 2
|
assert len(results) == 2
|
||||||
# Check two faces ages are the same
|
# Check two faces ages are the same in integer format(e.g. 23.6 -> 23)
|
||||||
assert np.array_equal(results[0], results[1])
|
# Must use int() to compare because of max float precision issue in different platforms
|
||||||
|
assert np.array_equal(int(results[0]), int(results[1]))
|
||||||
logger.info("✅ test batch detect age for multiple faces done")
|
logger.info("✅ test batch detect age for multiple faces done")
|
||||||
|
|
||||||
def test_batch_detect_emotion_for_multiple_faces():
|
def test_batch_detect_emotion_for_multiple_faces():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user