Exemple #1
0
    def test_video_dep_funcs_run(self):
        # just tests to check functions run
        # input_vid = 'https://s3.amazonaws.com/python-vidstab/trunc_video.avi'
        input_vid = local_trunc_vid

        stabilizer = VidStab()
        stabilizer.gen_transforms(input_vid,
                                  smoothing_window=1,
                                  show_progress=True)

        self.assertEqual(stabilizer.smoothed_trajectory.shape,
                         stabilizer.trajectory.shape,
                         'trajectory/transform obj shapes')
        self.assertEqual(stabilizer.transforms.shape,
                         stabilizer.trajectory.shape,
                         'trajectory/transform obj shapes')

        with tempfile.TemporaryDirectory() as tmpdir:
            output_vid = '{}/test_output.avi'.format(tmpdir)
            try:
                stabilizer.apply_transforms(input_vid, output_vid)
            except Exception as e:
                self.fail("stabilizer.apply_transforms ran into {}".format(e))

            try:
                stabilizer.stabilize(input_vid, output_vid, smoothing_window=1)
            except Exception as e:
                self.fail("stabilizer.stabilize ran into {}".format(e))
Exemple #2
0
def test_video_dep_funcs_run():
    # just tests to check functions run
    stabilizer = VidStab()
    stabilizer.gen_transforms(TRUNCATED_OSTRICH_VIDEO, smoothing_window=2, show_progress=True)

    assert stabilizer.smoothed_trajectory.shape == stabilizer.trajectory.shape
    assert stabilizer.transforms.shape == stabilizer.trajectory.shape

    with tempfile.TemporaryDirectory() as tmpdir:
        output_vid = '{}/test_output.avi'.format(tmpdir)
        stabilizer.apply_transforms(TRUNCATED_OSTRICH_VIDEO, output_vid)
        stabilizer.stabilize(TRUNCATED_OSTRICH_VIDEO, output_vid, smoothing_window=2)
def test_video_dep_funcs_run():
    # just tests to check functions run
    stabilizer = VidStab()
    stabilizer.gen_transforms(local_trunc_vid, smoothing_window=2, show_progress=True)

    assert stabilizer.smoothed_trajectory.shape == stabilizer.trajectory.shape
    assert stabilizer.transforms.shape == stabilizer.trajectory.shape

    with tempfile.TemporaryDirectory() as tmpdir:
        output_vid = '{}/test_output.avi'.format(tmpdir)
        try:
            stabilizer.apply_transforms(local_trunc_vid, output_vid)
        except Exception as e:
            pytest.fail("stabilizer.apply_transforms ran into {}".format(e))

        try:
            stabilizer.stabilize(local_trunc_vid, output_vid, smoothing_window=2)
        except Exception as e:
            pytest.fail("stabilizer.stabilize ran into {}".format(e))