Skip to content

Unit test failure #3797

@prabhat00155

Description

@prabhat00155
self = <test_videoapi.TestVideoApi testMethod=test_frame_reading>

    @unittest.skipIf(av is None, "PyAV unavailable")
    def test_frame_reading(self):
        for test_video, config in test_videos.items():
            full_path = os.path.join(VIDEO_DIR, test_video)
    
            av_reader = av.open(full_path)
    
            if av_reader.streams.video:
                video_reader = VideoReader(full_path, "video")
                for av_frame in av_reader.decode(av_reader.streams.video[0]):
                    vr_frame = next(video_reader)
    
                    self.assertAlmostEqual(
                        float(av_frame.pts * av_frame.time_base),
                        vr_frame["pts"],
                        delta=0.1,
                    )
    
                    av_array = torch.tensor(av_frame.to_rgb().to_ndarray()).permute(
                        2, 0, 1
                    )
                    vr_array = vr_frame["data"]
                    mean_delta = torch.mean(
                        torch.abs(av_array.float() - vr_array.float())
                    )
                    # on average the difference is very small and caused
                    # by decoding (around 1%)
                    # TODO: asses empirically how to set this? atm it's 1%
                    # averaged over all frames
>                   self.assertTrue(mean_delta.item() < 2.5)
E                   AssertionError: False is not true

test/test_videoapi.py:97: AssertionError

https://app.circleci.com/pipelines/github/pytorch/vision/7915/workflows/82c134ae-52a5-4b83-8dbe-22d3f30ce3e5/jobs/561557

cc @bjuncek

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions