MCPcopy Index your code
hub / github.com/DeepLabCut/DeepLabCut / plot_cost_matrix

Function plot_cost_matrix

deeplabcut/utils/pseudo_label.py:125–141  ·  view source on GitHub ↗
(matrix, gt_keypoint_names, pred_keypoint_names, conversion_plot_out_path)

Source from the content-addressed store, hash-verified

123
124
125def plot_cost_matrix(matrix, gt_keypoint_names, pred_keypoint_names, conversion_plot_out_path):
126
127 matrix /= np.max(matrix)
128 fig, ax = plt.subplots()
129 ax.pcolor(matrix, cmap=plt.cm.Blues, vmin=0, vmax=1)
130 ax.set_xticks(np.arange(matrix.shape[1]) + 0.5, minor=False)
131 ax.set_yticks(np.arange(matrix.shape[0]) + 0.5, minor=False)
132 ax.set_xlim(0, int(matrix.shape[1]))
133 ax.set_ylim(0, int(matrix.shape[0]))
134 ax.set_yticklabels(pred_keypoint_names, minor=False)
135 ax.set_xticklabels(gt_keypoint_names, minor=False)
136 ax.set_title("cost matrix")
137 plt.xticks(rotation=90)
138 fig = plt.gcf()
139 fig.tight_layout()
140
141 plt.savefig(conversion_plot_out_path, dpi=300)
142
143
144def keypoint_matching(

Callers 1

keypoint_matchingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected