Skip to content

Commit

Permalink
Loosen confidence in test_(co)x3d_learner
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasHedegaard committed Jul 11, 2021
1 parent 12bd0b0 commit dbbc51c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,11 @@ def test_infer(self):

# Input is Image
results2 = self.learner.infer(Image(batch[0], dtype=np.float))
assert torch.allclose(results1[0].confidence, results2[0].confidence)
assert torch.allclose(results1[0].confidence, results2[0].confidence, atol=1e-6)

# Input is List[Image]
results3 = self.learner.infer([Image(v, dtype=np.float) for v in batch])
assert all([torch.allclose(r1.confidence, r3.confidence) for (r1, r3) in zip(results1, results3)])
assert all([torch.allclose(r1.confidence, r3.confidence, atol=1e-6) for (r1, r3) in zip(results1, results3)])

def test_optimize(self):
self.learner.ort_session = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,12 @@ def test_infer(self):
# Input is Video
results2 = self.learner.infer(Video(batch[0]))
assert results1[0].data == results2[0].data
assert torch.allclose(results1[0].confidence, results2[0].confidence)
assert torch.allclose(results1[0].confidence, results2[0].confidence, atol=1e-6)

# Input is List[Video]
results3 = self.learner.infer([Video(v) for v in batch])
assert all([
r1.data == r3.data and torch.allclose(r1.confidence, r3.confidence)
r1.data == r3.data and torch.allclose(r1.confidence, r3.confidence, atol=1e-6)
for (r1, r3) in zip(results1, results3)
])

Expand Down

0 comments on commit dbbc51c

Please sign in to comment.