MCPcopy Create free account
hub / github.com/DeepLabCut/DeepLabCut / visualize_scoremaps

Function visualize_scoremaps

deeplabcut/core/visualization.py:32–49  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

30
31
32def 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
52def visualize_locrefs(

Callers 3

extract_save_all_mapsFunction · 0.90
visualize_locrefsFunction · 0.70

Calls 1

form_figureFunction · 0.85

Tested by

no test coverage detected