MCPcopy Create free account
hub / github.com/TonyLianLong/LLM-groundedDiffusion / visualize_arrays

Function visualize_arrays

utils/vis.py:20–41  ·  view source on GitHub ↗
(
    image_title_pairs, colorbar_index=-1, show_plot=True, figsize=None, **kwargs
)

Source from the content-addressed store, hash-verified

18
19
20def 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
44def visualize_masked_latents(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected