MCPcopy
hub / github.com/cvg/Hierarchical-Localization / cm_RdGn

Function cm_RdGn

hloc/utils/viz.py:15–19  ·  view source on GitHub ↗

Custom colormap: red (0) -> yellow (0.5) -> green (1).

(x)

Source from the content-addressed store, hash-verified

13
14
15def cm_RdGn(x):
16 """Custom colormap: red (0) -> yellow (0.5) -> green (1)."""
17 x = np.clip(x, 0, 1)[..., None]*2
18 c = x*np.array([[0, 1., 0]]) + (2-x)*np.array([[1., 0, 0]])
19 return np.clip(c, 0, 1)
20
21
22def plot_images(imgs, titles=None, cmaps='gray', dpi=100, pad=.5,

Callers 1

visualize_loc_from_logFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected