visualisation ============= .. py:module:: visualisation .. autoapi-nested-parse:: image generation functions Functions --------- .. autoapisummary:: visualisation.plot_curve visualisation.plot_3d visualisation._transparent_cmap visualisation.heatmap_plot visualisation.spectral_plot visualisation.surface_plot visualisation.overlay_grid visualisation.remove_background visualisation.voxel_plot visualisation.__transpose_mask visualisation.generate_colours visualisation.make_composite_mask visualisation.apply_boundaries_to_image visualisation.subplot_multi_explanations visualisation.__save_multi visualisation.save_contrastive visualisation.save_complete visualisation.save_multi_explanation visualisation.save_image visualisation.plot_image_grid Module Contents --------------- .. py:function:: plot_curve(curve, chunk_size, style='insertion', destination=None) plots an insertion/deletion curve of a responsibility map .. py:function:: plot_3d(input, ranking, ogrid, norm=255.0) plots a 3d grid in matplotlib given an image If is greyscale or RGBA, it is converted to RGB for plotting. .. py:function:: _transparent_cmap(cmap, N=255) Copy colormap and set alpha values .. py:function:: heatmap_plot(data, resp_map, colour, path=None) .. py:function:: spectral_plot(explanation, data, ranking, colour, extra=True, path=None) .. py:function:: surface_plot(input, args, resp_map, target, path=None) plots a 3d surface plot .. py:function:: overlay_grid(img, step_count=10) .. py:function:: remove_background(data, resp_map) Remove the background from the responsibility map if set in the Data object .. py:function:: voxel_plot(args, resp_map, data, path=None) Plot a 3D voxel plot of the responsibility map using plotly. - Assumes the data is greyscale Produces an interactive 3D plot of the data and the responsibility map. .. py:function:: __transpose_mask(mask, mode) .. py:function:: generate_colours(n, colourmap) Generate n evenly spaced RGB colours from a matplotlib colourmap. .. py:function:: make_composite_mask(explanations) Creates a composite mask from a list of masks. .. py:function:: apply_boundaries_to_image(image, explanations, colours) Draws the boundaries of the explanations on the image, using the provided colours. .. py:function:: subplot_multi_explanations(image, explanations, titles=None, alpha=0.5) .. py:function:: __save_multi(path, explanations_subset, data, img, colours_subset, args) .. py:function:: save_contrastive(explanation, data, args, path=None) .. py:function:: save_complete(explanation, data, args, path=None) .. py:function:: save_multi_explanation(explanations, data, args, clause=None, path=None) .. py:function:: save_image(mask, data, args, path=None) .. py:function:: plot_image_grid(images, ncols=None) Plot a grid of images