utils/visualization_utils
module¶
visualization_utils
¶
Functions¶
create_image_grid_visualization
¶
create_image_grid_visualization(images: list[tuple[str, np.ndarray | matplotlib.figure.Figure | None]], grid_size: tuple[int, int] = (2, 3), figsize: tuple[int, int] = (15, 10), save_path: str | None = None, dpi: int = 300) -> matplotlib.figure.Figure
Create a grid visualization of images with optional saving.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
images
|
list of tuple
|
List where each tuple contains (title, image) and image can be a numpy array, a matplotlib Figure, or None. |
required |
grid_size
|
tuple[int, int]
|
Tuple of (rows, columns) defining the grid layout; default is (2, 3). |
(2, 3)
|
figsize
|
tuple[int, int]
|
Size of the matplotlib figure in inches; default is (15, 10). |
(15, 10)
|
save_path
|
str | None
|
File path to save the figure; if None, the figure is not saved. |
None
|
dpi
|
int
|
Dots per inch for the saved image; default is 300. |
300
|
Returns:
Type | Description |
---|---|
matplotlib.figure.Figure
|
The created matplotlib figure containing the image grid. |