File: test_tile.py

package info (click to toggle)
python-imgviz 1.2.4%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 9,268 kB
  • sloc: python: 3,032; makefile: 15
file content (13 lines) | stat: -rw-r--r-- 404 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
import numpy as np

import imgviz


def test_tile():
    img1 = np.random.uniform(0, 255, (15, 25, 3)).round().astype(np.uint8)
    img2 = np.random.uniform(0, 255, (25, 25, 3)).round().astype(np.uint8)
    img3 = np.random.uniform(0, 255, (25, 10, 3)).round().astype(np.uint8)
    tiled = imgviz.tile([img1, img2, img3], (1, 3))

    assert tiled.shape == (25, 75, 3)
    assert tiled.dtype == np.uint8