示例#1
0
文件: test_utils.py 项目: Nanne/dvt
    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)
示例#2
0
文件: test_utils.py 项目: Nanne/dvt
    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)
示例#3
0
    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)
示例#4
0
    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)
示例#5
0
    def test_sub_image(self, test_img):

        simg = sub_image(test_img, 0, 128, 64, 0)
        assert simg.shape == (64, 128, 3)