示例#1
0
 def run_serial(data, size, mode):
     """
     Run the median filter in serial.
     """
     th.switch_mp_off()
     cpu_result = MedianFilter.filter_func(data, size, mode)
     th.switch_mp_on()
     return cpu_result
示例#2
0
    def test_executed_no_helper_seq(self):
        images = th.generate_images()

        size = 3
        mode = 'reflect'

        original = np.copy(images.data[0])
        th.switch_mp_off()
        result = MedianFilter.filter_func(images, size, mode)
        th.switch_mp_on()

        th.assert_not_equals(result.data, original)
 def test_executed_seq(self):
     th.switch_mp_off()
     self.do_execute()
     th.switch_mp_on()
示例#4
0
 def test_executed_xy_seq_1024_1024(self):
     th.switch_mp_off()
     self.do_execute_xy((1024, 1024))
     th.switch_mp_on()
示例#5
0
 def test_executed_xy_seq_512_256(self):
     th.switch_mp_off()
     self.do_execute_xy((512, 256))
     th.switch_mp_on()
示例#6
0
 def test_executed_xy_seq_128_256(self):
     th.switch_mp_off()
     self.do_execute_xy((128, 256))
     th.switch_mp_on()
示例#7
0
 def test_executed_uniform_seq_5_int(self):
     th.switch_mp_off()
     self.do_execute_uniform(5.0, np.int32)
     th.switch_mp_on()
示例#8
0
 def test_executed_uniform_seq_5(self):
     th.switch_mp_off()
     self.do_execute_uniform(5.0)
     th.switch_mp_on()