(pred, label, num_cls)
| 153 | |
| 154 | |
| 155 | def hist_info(pred, label, num_cls): |
| 156 | assert pred.shape == label.shape |
| 157 | k = (label >= 0) & (label < num_cls) |
| 158 | labeled = np.sum(k) |
| 159 | correct = np.sum((pred[k] == label[k])) |
| 160 | |
| 161 | return np.bincount(num_cls * label[k].astype(int) + pred[k], minlength=num_cls ** 2).reshape(num_cls, |
| 162 | num_cls), labeled, correct |
| 163 | |
| 164 | |
| 165 | def compute_score(hist, correct, labeled): |
nothing calls this directly
no outgoing calls
no test coverage detected