-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_eval.py
More file actions
35 lines (31 loc) · 1.24 KB
/
Copy path_eval.py
File metadata and controls
35 lines (31 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from errors import *
import util
from config import Config
from ai import AI
def main(cmd_list, config: Config, detector: AI):
print("Preparing for ink evaluation...\n")
print("DO NOT let machine turn off or sleep during this process.")
print("Close all other programs for best performance.")
print("Press enter when you are ready to continue.")
util.pause()
util.clear()
try:
config = Config()
thresholds = []
for entry in config.get("threshold").split(","):
entry = entry.strip()
if entry.lower() == "none":
thresholds.append(None)
else:
thresholds.append(float(entry))
for threshold in thresholds:
if threshold is None:
print("Running in grayscale mode (raw probability output)...")
else:
print(f"Running using {threshold * 100}% threshold...")
detector.eval_model(threshold)
util.clear()
except Exception as e:
print("There was an error during the evaluation proccess. Please ensure all settings are valid and correct.")
print("If error persists, contact the developers or start an issue at our repository.")
print(f"Error: {e}")