From 4efb7d59c0d42e32ba6f94cc968f3274eab850c6 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 8 Jun 2022 22:36:47 +0200 Subject: [PATCH] Fix some typos (most of them found by codespell) Signed-off-by: Stefan Weil --- pero_ocr/confidence_estimation.py | 2 +- pero_ocr/force_alignment.py | 2 +- pero_ocr/layout_engines/cnn_layout_engine.py | 2 +- pero_ocr/ocr_engine/line_ocr_engine.py | 2 +- user_scripts/parse_folder.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pero_ocr/confidence_estimation.py b/pero_ocr/confidence_estimation.py index f55e73a..20c24ff 100644 --- a/pero_ocr/confidence_estimation.py +++ b/pero_ocr/confidence_estimation.py @@ -10,7 +10,7 @@ def get_letter_confidence(logits: np.ndarray, alignment: typing.List[int], blank Args: logits: numpy array of (unnormalized) log-probabilities of symbols, organized as (time, symbol). - alignment: a list of symbols assigned to indivudual time frames + alignment: a list of symbols assigned to individual time frames blank_symbol: index of CTC blank in logits, also its representation in alignment Returns: diff --git a/pero_ocr/force_alignment.py b/pero_ocr/force_alignment.py index f6232f8..1c67617 100644 --- a/pero_ocr/force_alignment.py +++ b/pero_ocr/force_alignment.py @@ -22,7 +22,7 @@ def force_align(neg_logprobs: np.ndarray, symbols_seq: typing.List[int], blank_s A list of symbols corresponding to the most probable path, including CTC blanks. Raises: - ValueError: On various occassions :-) + ValueError: On various occasions :-) """ complete_seq, char_sequence = complete_state_seq(symbols_seq, blank_symbol) A = hmm_trans_from_string(symbols_seq) diff --git a/pero_ocr/layout_engines/cnn_layout_engine.py b/pero_ocr/layout_engines/cnn_layout_engine.py index d8f109e..7d238b1 100644 --- a/pero_ocr/layout_engines/cnn_layout_engine.py +++ b/pero_ocr/layout_engines/cnn_layout_engine.py @@ -164,7 +164,7 @@ def parse(self, out_map, downsample): print('MAP RES:', out_map.shape) out_map[:, :, 4][out_map[:, :, 4] < 0] = 0 - # expand line heights verticaly + # expand line heights vertically heights_map = ndimage.morphology.grey_dilation( out_map[:, :, :2], size=(5, 1, 1)) diff --git a/pero_ocr/ocr_engine/line_ocr_engine.py b/pero_ocr/ocr_engine/line_ocr_engine.py index cc5d1dd..347d23f 100644 --- a/pero_ocr/ocr_engine/line_ocr_engine.py +++ b/pero_ocr/ocr_engine/line_ocr_engine.py @@ -59,7 +59,7 @@ def process_lines(self, lines, sparse_logits=True, tight_crop_logits=False, no_l if line.shape[0] == self.line_px_height: ValueError("Line height needs to be {} for this ocr network and is {} instead.".format(self.line_px_height, line.shape[0])) if line.shape[2] == 3: - ValueError("Line crops need three color channes, but this one has {}.".format(line.shape[2])) + ValueError("Line crops need three color channels, but this one has {}.".format(line.shape[2])) all_transcriptions = [None]*len(lines) all_logits = [None]*len(lines) diff --git a/user_scripts/parse_folder.py b/user_scripts/parse_folder.py index c07c9b7..a74af8f 100644 --- a/user_scripts/parse_folder.py +++ b/user_scripts/parse_folder.py @@ -36,7 +36,7 @@ def parse_arguments(): parser.add_argument('--output-logit-path', help='') parser.add_argument('--output-alto-path', help='') parser.add_argument('--output-transcriptions-file-path', help='') - parser.add_argument('--skipp-missing-xml', action='store_true', help='Skipp images which have missing xml.') + parser.add_argument('--skipp-missing-xml', action='store_true', help='Skip images which have missing xml.') parser.add_argument('--set-gpu', action='store_true', help='Sets visible CUDA device to first unused GPU.') parser.add_argument('--process-count', type=int, default=1, help='Number of parallel processes (this works mostly only for line cropping and it probably fails and crashes for most other uses cases).') args = parser.parse_args()