MCPcopy Create free account
hub / github.com/dmlc/decord / test_bytes_io

Function test_bytes_io

tests/python/unittests/test_video_reader.py:97–103  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95 assert np.allclose(frame_ts[:,0], [0.0, 0.03125, 0.0625, 0.09375]), frame_ts[:,0]
96
97def test_bytes_io():
98 fn = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..', 'examples', 'flipping_a_pancake.mkv'))
99 with open(fn, 'rb') as f:
100 vr = VideoReader(f)
101 assert len(vr) == 310
102 vr2 = _get_default_test_video()
103 assert np.mean(np.abs(vr[10].asnumpy().astype('float') - vr2[10].asnumpy().astype('float'))) < 2 # average pixel diff < 2
104
105
106if __name__ == '__main__':

Callers

nothing calls this directly

Calls 3

VideoReaderClass · 0.90
asnumpyMethod · 0.80
_get_default_test_videoFunction · 0.70

Tested by

no test coverage detected