code: def label_accuracy_score(label_trues, label_preds, n_class):
      
      hist = np.zeros((n_class, n_class))
      for lt, lp in zip(label_trues, label_preds):
          hist += _fast_hist(lt.flatten(), lp.flatten(), n_class)
      acc = np.diag(hist).sum() / hist.sum()
      with np.errstate(divide='ignore', invalid='ignore'):
          acc_cls = np.diag(hist) / hist.sum(axis=1)
      acc_cls = np.nanmean(acc_cls)
      with np.errstate(divide='ignore', invalid='ignore'):
          iu = np.diag(hist) / (
              hist.sum(axis=1) + hist.sum(axis=0) - np.diag(hist)
          )
      mean_iu = np.nanmean(iu)
      freq = hist.sum(axis=1) / hist.sum()
      fwavacc = (freq[freq > 0] * iu[freq > 0]).sum()
      return acc, acc_cls, mean_iu, fwavacc
docs: Returns accuracy score evaluation result.
  
        - overall accuracy
        - mean accuracy
        - mean IU
        - fwavacc