Image Classification
ONNX
onnxruntime
document-orientation
deskew
ocr
image-preprocessing
cpu
File size: 568 Bytes
88248d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""Classify one native-view orientation decision."""

def outcome(truth, prediction, accepted):
    if truth is None:
        if not accepted:
            return "unclear_referred"
        return "unclear_changed" if prediction else "unclear_kept"
    if not accepted:
        return "upright_referred" if truth==0 else "turned_referred"
    if truth==0:
        return "upright_wrong_change" if prediction else "upright_correct_keep"
    if prediction==truth:
        return "turned_corrected"
    return "turned_wrong_change" if prediction else "turned_wrong_keep"