diff --git a/frigate/data_processing/common/license_plate/mixin.py b/frigate/data_processing/common/license_plate/mixin.py index ef43632d0..66a0f63c9 100644 --- a/frigate/data_processing/common/license_plate/mixin.py +++ b/frigate/data_processing/common/license_plate/mixin.py @@ -1615,9 +1615,9 @@ class CTCDecoder: self.characters = [] if character_dict_path and os.path.exists(character_dict_path): with open(character_dict_path, "r", encoding="utf-8") as f: - self.characters = ["blank"] + [ - line.strip() for line in f if line.strip() - ] + self.characters = ( + ["blank"] + [line.strip() for line in f if line.strip()] + [" "] + ) else: self.characters = [ "blank", @@ -1752,7 +1752,7 @@ class CTCDecoder: merged_path.append(char_index) merged_probs.append(seq_log_probs[t, char_index]) - result = "".join(self.char_map[idx] for idx in merged_path) + result = "".join(self.char_map.get(idx, "") for idx in merged_path) results.append(result) confidence = np.exp(merged_probs).tolist()