Skip to content

Commit

Permalink
Merge pull request #115 from breezedeus/dev
Browse files Browse the repository at this point in the history
bugfix
  • Loading branch information
breezedeus authored Jun 4, 2024
2 parents 7c65953 + 2ea128f commit ca10b86
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
10 changes: 10 additions & 0 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Release Notes

## Update 2024.06.04:**V1.1.0.6** Released

Major changes:

* Fix: The Text OCR incorrectly carried over the configuration from previous calls when it was called multiple times.

主要变更:

* 修复 bug:Text OCR 多次调用时错误沿用了之前的配置信息。

## Update 2024.05.27:**V1.1.0.5** Released

Major changes:
Expand Down
2 changes: 1 addition & 1 deletion pix2text/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# [Pix2Text](https://github.com/breezedeus/pix2text): an Open-Source Alternative to Mathpix.
# Copyright (C) 2022-2024, [Breezedeus](https://www.breezedeus.com).

__version__ = '1.1.0.5'
__version__ = '1.1.0.6'
2 changes: 2 additions & 0 deletions pix2text/ocr_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# [Pix2Text](https://github.com/breezedeus/pix2text): an Open-Source Alternative to Mathpix.
# Copyright (C) 2022-2024, [Breezedeus](https://www.breezedeus.com).
import string
from copy import deepcopy
from typing import Sequence, List, Optional

import numpy as np
Expand Down Expand Up @@ -175,6 +176,7 @@ def ocr(


def prepare_ocr_engine(languages: Sequence[str], ocr_engine_config):
ocr_engine_config = deepcopy(ocr_engine_config) if ocr_engine_config else {}
if len(set(languages).difference({'en', 'ch_sim'})) == 0:
from cnocr import CnOcr

Expand Down
4 changes: 2 additions & 2 deletions pix2text/text_formula_ocr.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def prepare_configs(
):
def _to_default(_conf, _def_val):
if not _conf:
_conf = _def_val
return _conf
_conf = deepcopy(_def_val)
return deepcopy(_conf)

mfd_config = _to_default(mfd_config, DEFAULT_CONFIGS['mfd'])
# FIXME
Expand Down

0 comments on commit ca10b86

Please sign in to comment.