From 69a55059e99946e53ff3ee988a24eecc81d548b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sol=C3=A8ne=20Tarride?= <starride@teklia.com> Date: Fri, 24 Feb 2023 00:37:13 +0100 Subject: [PATCH] update doc --- docs/usage/predict.md | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/docs/usage/predict.md b/docs/usage/predict.md index 4c5d9050..4cf262d5 100644 --- a/docs/usage/predict.md +++ b/docs/usage/predict.md @@ -1,22 +1,24 @@ # Predict -## Description - Use the `teklia-dan predict` command to predict a trained DAN model on an image. -| Parameter | Description | Type | Default | -| ------------------------------ | ---------------------------------------------------------------------------- | -------- | ------- | -| `--image` | Path to the image to predict. | `Path` | | -| `--model` | Path to the model to use for prediction | `Path` | | -| `--parameters` | Path to the YAML parameters file. | `Path` | | -| `--charset` | Path to the charset file. | `Path` | | -| `--output` | Path to the output folder. Results will be saved in this directory. | `Path` | | -| `--scale` | Image scaling factor before feeding it to DAN. | `float` | 1.0 | -| `--confidence-score` | Whether to return confidence scores. | `bool` | False | -| `--attention-map` | Whether to plot attention maps. | `bool` | False | -| `--attention-map-level` | Level to plot the attention maps. Should be in `["line", "word", "char"]`. | `str` | line | -| `--attention-map-scale` | Image scaling factor before creating the GIF. | `float` | 0.5 | - +## Description of parameters + +| Parameter | Description | Type | Default | +| --------------------------- | -------------------------------------------------------------------------------------------- | ------- | ------------- | +| `--image` | Path to the image to predict. | `Path` | | +| `--model` | Path to the model to use for prediction | `Path` | | +| `--parameters` | Path to the YAML parameters file. | `Path` | | +| `--charset` | Path to the charset file. | `Path` | | +| `--output` | Path to the output folder. Results will be saved in this directory. | `Path` | | +| `--scale` | Image scaling factor before feeding it to DAN. | `float` | `1.0` | +| `--confidence-score` | Whether to return confidence scores. | `bool` | `False` | +| `--confidence-score-levels` | Level to return confidence scores. Should be any combination of `["line", "word", "char"]`. | `str` | | +| `--attention-map` | Whether to plot attention maps. | `bool` | `False` | +| `--attention-map-scale` | Image scaling factor before creating the GIF. | `float` | `0.5` | +| `--attention-map-level` | Level to plot the attention maps. Should be in `["line", "word", "char"]`. | `str` | `"line"` | +| `--word-separators` | List of word separators. | `list` | `[" ", "\n"]` | +| `--line-separators` | List of line separators. | `list` | `["\n"]` | ## Examples @@ -101,10 +103,3 @@ It will create the following JSON file named `dan_humu_page/predict/example.json <video autoplay> <source src="../assets/example_word.gif"> </video> - -## Remarks - -The script plotting attention maps assumes that: - -* words are separated with the symbol ` ` -* lines are separated with the symbol `\n` -- GitLab