Skip to content
Snippets Groups Projects

Enum for confidence level

Merged Manon Blanco requested to merge enum-for-level into main
All threads resolved!
4 files
+ 66
53
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -5,6 +5,7 @@ Predict on an image using a trained DAN model.
import pathlib
from dan.ocr.predict.attention import Level
from dan.ocr.predict.prediction import run
from dan.utils import parse_tokens
@@ -81,7 +82,7 @@ def add_predict_parser(subcommands) -> None:
parser.add_argument(
"--confidence-score-levels",
default=[],
type=str,
type=Level,
nargs="+",
help="Levels of confidence scores. Should be a list of any combinaison of ['char', 'word', 'line'].",
required=False,
@@ -94,10 +95,9 @@ def add_predict_parser(subcommands) -> None:
)
parser.add_argument(
"--attention-map-level",
type=str,
choices=["line", "word", "char"],
default="line",
help="Level of attention maps.",
type=Level,
default=Level.Line,
help="Level to plot the attention maps. Should be in ['line', 'word', 'char'].",
required=False,
)
parser.add_argument(
Loading