class_docstr: 注意，如果显示的图像不全，是matplotlib版本问题
  本例程使用matplotlib-3.2.1(windows and ubuntu)绘制正常
  需要额外安装prettytable库
class_docstr_tok: ["\u6ce8\u610f\uff0c\u5982\u679c\u663e\u793a\u7684\u56fe\u50cf\u4e0d\u5168\uff0c\u662fmatplotlib\u7248\u672c\u95ee\u9898","\u672c\u4f8b\u7a0b\u4f7f\u7528matplotlib-3.2.1","(","windows","and","ubuntu",")","\u7ed8\u5236\u6b63\u5e38","\u9700\u8981\u989d\u5916\u5b89\u88c5prettytable\u5e93"]
code: def summary(self):
      # calculate accuracy
      sum_TP = 0
      for i in range(self.num_classes):
          sum_TP += self.matrix[i, i]
      acc = sum_TP / np.sum(self.matrix)
      print("the model accuracy is ", acc)
  
      # precision, recall, specificity
      table = PrettyTable()
      table.field_names = ["", "Precision", "Recall", "Specificity"]
      for i in range(self.num_classes):
          TP = self.matrix[i, i]
          FP = np.sum(self.matrix[i, :]) - TP
          FN = np.sum(self.matrix[:, i]) - TP
          TN = np.sum(self.matrix) - TP - FP - FN
          Precision = round(TP / (TP + FP), 3) if TP + FP != 0 else 0.0
          Recall = round(TP / (TP + FN), 3) if TP + FN != 0 else 0.0
          Specificity = (
              round(TN / (TN + FP), 3) if TN + FP != 0 else 0.0
          )
          table.add_row(
              [self.labels[i], Precision, Recall, Specificity]
          )
      print(table)
  
file_path: deep-learning-for-image-processing/pytorch_classification/ConfusionMatrix/main.py
imports: import os
  import json
  import torch
  from torchvision import transforms, datasets
  import numpy
  from tqdm import tqdm
  import matplotlib.pyplot
  from prettytable import PrettyTable
  from model import MobileNetV2
label_desc: Use image node_id 3 for calling the ConfusionMatrix obj's underlying member method code with example usage: obj.summary() without return types