<gh_stars>0
import os
import csv
import numpy as np
import seaborn as sns
import matplotlib as mpl
import matplotlib.pyplot as plt
import argparse
from pathlib import Path
import glob
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score

num_class=10

num=1
correct=0
total=0

accum = np.zeros((10,10), dtype=float)

parser = argparse.ArgumentParser()
parser.add_argument('--csv', type=str, required=True, help='csv')
args = parser.parse_args()

data=np.loadtxt(args.csv)

acc=np.sum(np.diag(data))/np.sum(data) * 100.0
print ("average\t%.3f" % acc)
print ("---")

for n in range(num_class):
    acc=data[n,n]/np.sum(data, axis=1)[n] * 100.0
    print("%d\t%.3f" % (n, acc))
