Esempio n. 1
0
    def test_continue_bnum(self):
        fobj = FrameInput("test-data/video-clip.mp4", bsize=256)

        batch = fobj.next_batch()
        assert batch.bnum == 0
        assert fobj.continue_read

        batch = fobj.next_batch()
        assert batch.bnum == 1
        assert not fobj.continue_read

        frames = batch.get_frames()
        bwidth = frames[batch.bsize :, :, :, :]
        assert np.max(bwidth) == 0
Esempio n. 2
0
    def test_batch_size(self):
        fobj = FrameInput("test-data/video-clip.mp4", bsize=4)

        batch = fobj.next_batch()
        bframes = batch.get_batch()
        assert bframes.shape[0] == 4
        assert batch.bsize == 4
Esempio n. 3
0
    def test_batch_bsize(self):
        fobj = FrameInput("test-data/video-clip.mp4", bsize=16)
        batch = fobj.next_batch()
        frames = batch.get_batch()

        assert batch.bnum == 0
        assert fobj.continue_read
        assert frames.shape[0] == 16
Esempio n. 4
0
    def test_get_frame_names(self):
        fobj = FrameInput("test-data/video-clip.mp4", bsize=4)

        batch = fobj.next_batch()
        batch = fobj.next_batch()
        fnames = batch.get_frame_names()

        assert fnames == [4, 5, 6, 7]
Esempio n. 5
0
    def test_bandwidh_size(self):
        fobj = FrameInput("test-data/video-clip.mp4", bsize=4)

        batch = fobj.next_batch()
        frames = batch.get_frames()
        assert frames.shape[0] == 8