def test_sub_image_reshape(self): finput = FrameInput("test-data/video-clip.mp4", bsize=1) batch = get_batch(finput, batch_num=0) img = batch.get_frames()[0, :, :, :] simg = sub_image(img, 32, 64, 64, 32, output_shape=(100, 100)) assert simg.shape == (100, 100, 3)
def test_sub_image_fct(self): finput = FrameInput("test-data/video-clip.mp4", bsize=1) batch = get_batch(finput, batch_num=0) img = batch.get_frames()[0, :, :, :] simg = sub_image(img, top=0, right=128, bottom=64, left=0, fct=1.5) assert simg.shape == (80, 160, 3)
def test_sub_image_fct(self, test_img): simg = sub_image(test_img, 0, 128, 64, 0, fct=1.5) assert simg.shape == (80, 160, 3)
def test_sub_image_reshape(self, test_img): simg = sub_image(test_img, 32, 64, 64, 32, output_shape=(100, 100)) assert simg.shape == (100, 100, 3)
def test_sub_image(self, test_img): simg = sub_image(test_img, 0, 128, 64, 0) assert simg.shape == (64, 128, 3)