MCPcopy Index your code
hub / github.com/visionml/pytracking / plot_graph

Function plot_graph

pytracking/utils/plotting.py:32–47  ·  view source on GitHub ↗

Plot graph. Data is a 1D tensor. args: fig_num: Figure number. title: Title of figure.

(a: torch.Tensor, fig_num = None, title = None)

Source from the content-addressed store, hash-verified

30
31
32def plot_graph(a: torch.Tensor, fig_num = None, title = None):
33 """Plot graph. Data is a 1D tensor.
34 args:
35 fig_num: Figure number.
36 title: Title of figure.
37 """
38 a_np = a.squeeze().cpu().clone().detach().numpy()
39 if a_np.ndim > 1:
40 raise ValueError
41 fig = plt.figure(fig_num)
42 # plt.tight_layout()
43 plt.cla()
44 plt.plot(a_np)
45 if title is not None:
46 plt.title(title)
47 draw_figure(fig)

Callers 8

init_classifierMethod · 0.90
update_classifierMethod · 0.90
runMethod · 0.90
runMethod · 0.90
runMethod · 0.90
runMethod · 0.90
runMethod · 0.90
runMethod · 0.90

Calls 1

draw_figureFunction · 0.85

Tested by

no test coverage detected