(
image_title_pairs, colorbar_index=-1, show_plot=True, figsize=None, **kwargs
)
| 18 | |
| 19 | |
| 20 | def visualize_arrays( |
| 21 | image_title_pairs, colorbar_index=-1, show_plot=True, figsize=None, **kwargs |
| 22 | ): |
| 23 | if figsize is not None: |
| 24 | plt.figure(figsize=figsize) |
| 25 | num_subplots = len(image_title_pairs) |
| 26 | for idx, image_title_pair in enumerate(image_title_pairs): |
| 27 | plt.subplot(1, num_subplots, idx + 1) |
| 28 | if isinstance(image_title_pair, (list, tuple)): |
| 29 | image, title = image_title_pair |
| 30 | else: |
| 31 | image, title = image_title_pair, None |
| 32 | |
| 33 | if title is not None: |
| 34 | plt.title(title) |
| 35 | |
| 36 | plt.imshow(image, **kwargs) |
| 37 | if idx == colorbar_index: |
| 38 | plt.colorbar() |
| 39 | |
| 40 | if show_plot: |
| 41 | plt.show() |
| 42 | |
| 43 | |
| 44 | def visualize_masked_latents( |
nothing calls this directly
no outgoing calls
no test coverage detected