Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)