Skip to content

Commit

Permalink
Reduce the unit test resolution to make it faster.
Browse files Browse the repository at this point in the history
  • Loading branch information
nburrus committed May 20, 2022
1 parent 0c48e16 commit 45c73c2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions stereodemo/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class EnumParameter:
def set_index (self, idx: int):
self.index = idx

def set_value (self, value):
self.index = self.values.index(value)

@property
def value(self) -> str:
return self.values[self.index]
Expand Down
16 changes: 12 additions & 4 deletions tests/test_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,24 @@ def test_sgbm(self):
self.check_method (method_opencv_bm.StereoSGBM(), 5.1875, 0.8515)

def test_chang_realtime(self):
self.check_method (method_chang_realtime_stereo.ChangRealtimeStereo(), 8.5121, 1.0)
m = method_chang_realtime_stereo.ChangRealtimeStereo()
m.parameters["Shape"].set_value ("320x240")
self.check_method (m, 12.7776, 1.0)

def test_hitnet(self):
self.check_method (method_hitnet.HitnetStereo(), 5.1079, 1.0)
m = method_hitnet.HitnetStereo()
m.parameters["Shape"].set_value ("320x240")
self.check_method (m, 4.9103, 1.0)

def test_crestereo(self):
self.check_method (method_cre_stereo.CREStereo(), 4.6947, 1.0)
m = method_cre_stereo.CREStereo()
m.parameters["Shape"].set_value ("320x240")
self.check_method (m, 4.6287, 1.0)

def test_raft_stereo(self):
self.check_method (method_raft_stereo.RaftStereo(), 4.7230, 1.0)
m = method_raft_stereo.RaftStereo()
m.parameters["Shape"].set_value ("320x256")
self.check_method (m, 4.6408, 1.0)


if __name__ == '__main__':
Expand Down

0 comments on commit 45c73c2

Please sign in to comment.