Plots scoremaps as an image overlay. Args: image: An image as a numpy array of shape (h, w, channels) scmap: A scoremap of shape (h, w) Returns: The figure and axis on which the image scoremap was plot.
(
image: np.ndarray,
scmap: np.ndarray,
)
| 30 | |
| 31 | |
| 32 | def visualize_scoremaps( |
| 33 | image: np.ndarray, |
| 34 | scmap: np.ndarray, |
| 35 | ) -> tuple[plt.Figure, plt.Axes]: |
| 36 | """Plots scoremaps as an image overlay. |
| 37 | |
| 38 | Args: |
| 39 | image: An image as a numpy array of shape (h, w, channels) |
| 40 | scmap: A scoremap of shape (h, w) |
| 41 | |
| 42 | Returns: |
| 43 | The figure and axis on which the image scoremap was plot. |
| 44 | """ |
| 45 | ny, nx = np.shape(image)[:2] |
| 46 | fig, ax = form_figure(nx, ny) |
| 47 | ax.imshow(image) |
| 48 | ax.imshow(scmap, alpha=0.5) |
| 49 | return fig, ax |
| 50 | |
| 51 | |
| 52 | def visualize_locrefs( |
no test coverage detected