Functions | |
| load_model () | |
Variables | |
| list | classes |
| device = torch.device("cuda" if torch.cuda.is_available() else "cpu") | |
| model = load_model() | |
| ds = load_dataset("amaye15/invoices-google-ocr") | |
| df = pd.DataFrame(ds['test']) | |
| int | N = 50 |
| random_images = df.sample(N) | |
| list | true = ['invoice'] * N |
| list | resulted = [] |
| image = image.convert("RGB") | |
| outputs = model(image) | |
| _ | |
| predicted | |
| int | accuracy = sum([1 for i, j in zip(true, resulted) if i == j]) / N |
| cm = confusion_matrix(true, resulted, labels=classes) | |
| figsize | |
| annot | |
| True | |
| fmt | |
| xticklabels | |
| yticklabels | |
| classification.outofbag_test.load_model | ( | ) |
|
protected |
| classification.outofbag_test.annot |
| classification.outofbag_test.classes |
| classification.outofbag_test.device = torch.device("cuda" if torch.cuda.is_available() else "cpu") |
| classification.outofbag_test.df = pd.DataFrame(ds['test']) |
| classification.outofbag_test.ds = load_dataset("amaye15/invoices-google-ocr") |
| classification.outofbag_test.figsize |
| classification.outofbag_test.fmt |
| classification.outofbag_test.image = image.convert("RGB") |
| classification.outofbag_test.model = load_model() |
| int classification.outofbag_test.N = 50 |
| classification.outofbag_test.predicted |
| classification.outofbag_test.random_images = df.sample(N) |
| list classification.outofbag_test.resulted = [] |
| list classification.outofbag_test.true = ['invoice'] * N |
| classification.outofbag_test.True |
| classification.outofbag_test.xticklabels |
| classification.outofbag_test.yticklabels |