Skip to content

Commit

Permalink
Fix some typos (most of them found by codespell)
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Jun 8, 2022
1 parent ecbbd7a commit 4efb7d5
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pero_ocr/confidence_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pero_ocr/force_alignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pero_ocr/layout_engines/cnn_layout_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
2 changes: 1 addition & 1 deletion pero_ocr/ocr_engine/line_ocr_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion user_scripts/parse_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4efb7d5

Please sign in to comment.