(hist, correct, labeled)
| 163 | |
| 164 | |
| 165 | def compute_score(hist, correct, labeled): |
| 166 | iu = np.diag(hist) / (hist.sum(1) + hist.sum(0) - np.diag(hist)) |
| 167 | mean_IU = np.nanmean(iu) |
| 168 | mean_IU_no_back = np.nanmean(iu[1:]) |
| 169 | freq = hist.sum(1) / hist.sum() |
| 170 | freq_IU = (iu[freq > 0] * freq[freq > 0]).sum() |
| 171 | mean_pixel_acc = correct / labeled |
| 172 | |
| 173 | return iu, mean_IU, mean_IU_no_back, mean_pixel_acc |
nothing calls this directly
no outgoing calls
no test coverage detected