lagom.vis: Visualization¶
-
class
lagom.vis.
ImageViewer
(max_width=500)[source]¶ Display an image from an RGB array in an OpenGL window.
Example:
imageviewer = ImageViewer(max_width=500) image = np.asarray(Image.open('x.jpg')) imageviewer(image)
-
class
lagom.vis.
GridImage
(ncol=8, padding=2, pad_value=0)[source]¶ Generate a grid of images. The images can be iteratively added.
Example:
grid = GridImage(ncol=8, padding=5, pad_value=0) a = np.random.randint(0, 255+1, size=[10, 3, 64, 64]) grid.add(a) grid()
Reference:
Parameters: - ncol (int, optional) – Number of images to show in each row of the grid. Final grid size is [N/ncol, ncol]. Default: 8.
- padding (int, optional) – Number of paddings. Default: 2.
- pad_value (float, optional) – Padding value in the range [0, 255]. Black is 0 and white 255. Default: 0