コード例 #1
0
 def identity_test(self):
     samples = numpy.array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]).transpose()
     numpy.testing.assert_array_equal(
         block_functions.fix_frame_count(samples, 5), samples)
     samples = numpy.array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]).transpose()
     numpy.testing.assert_array_equal(
         block_functions.fix_frame_count(samples, -5), samples)
コード例 #2
0
 def identity_test(self):
     samples = numpy.array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]).transpose()
     numpy.testing.assert_array_equal(block_functions.fix_frame_count(samples, 5), samples)
     samples = numpy.array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]).transpose()
     numpy.testing.assert_array_equal(block_functions.fix_frame_count(samples, -5), samples)
コード例 #3
0
 def crop_test_before(self):
     samples = numpy.array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]).transpose()
     cropped_samples = numpy.array([[2, 3, 4], [7, 8, 9]]).transpose()
     numpy.testing.assert_array_equal(block_functions.fix_frame_count(samples, -3), cropped_samples)
コード例 #4
0
 def pad_test_before(self):
     samples = numpy.array([[1, 2, 3, 4, 5], [5, 6, 7, 8, 9]]).transpose()
     padded_samples = numpy.array([[0, 0, 1, 2, 3, 4, 5], [0, 0, 5, 6, 7, 8, 9]]).transpose()
     numpy.testing.assert_array_equal(block_functions.fix_frame_count(samples, -7), padded_samples)
コード例 #5
0
 def pad_test(self):
     samples = numpy.array([[1, 2, 3, 4, 5], [5, 6, 7, 8, 9]]).transpose()
     padded_samples = numpy.array([[1, 2, 3, 4, 5, 0, 0],
                                   [5, 6, 7, 8, 9, 0, 0]]).transpose()
     numpy.testing.assert_array_equal(
         block_functions.fix_frame_count(samples, 7), padded_samples)
コード例 #6
0
 def crop_test_before(self):
     samples = numpy.array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]).transpose()
     cropped_samples = numpy.array([[2, 3, 4], [7, 8, 9]]).transpose()
     numpy.testing.assert_array_equal(
         block_functions.fix_frame_count(samples, -3), cropped_samples)