瀏覽代碼

code cleanup

master
Evgeniy Ierusalimov 3 天之前
父節點
當前提交
b97d185904
共有 3 個檔案被更改,包括 19 行新增134 行删除
  1. 19
    117
      requirements.txt
  2. 0
    3
      src/latex/__init__.py
  3. 0
    14
      src/split/slicer.py

+ 19
- 117
requirements.txt 查看文件

@@ -1,118 +1,20 @@
1
-aiohappyeyeballs==2.7.1
2
-aiohttp==3.14.3
3
-aiosignal==1.4.0
4
-aistudio_sdk==0.3.9
5
-annotated-doc==0.0.5
6
-annotated-types==0.8.0
7
-anyio==4.14.2
8
-attrs==26.1.0
9
-bce-python-sdk==0.9.76
10
-beautifulsoup4==4.15.0
11
-cachetools==7.1.7
12
-certifi==2026.7.22
13
-chardet==7.4.3
14
-charset-normalizer==3.4.9
15
-click==8.4.2
16
-colorlog==6.12.0
17
-crc32c==2.8
18
-cssselect==1.5.0
19
-cssutils==2.15.0
20
-diskcache==5.6.3
21
-distro==1.9.0
22
-docling==2.117.0
23
-einops==0.8.2
24
-encutils==1.0.0
25
-et_xmlfile==2.0.0
26
-filelock==3.32.2
27
-filetype==1.2.0
28
-frozenlist==1.8.0
29
-fsspec==2026.7.0
30
-ftfy==6.3.1
31
-future==1.0.0
32
-h11==0.16.0
33
-hf-xet==1.5.2
34
-httpcore==1.0.9
35
-httpx==0.28.1
36
-huggingface_hub==1.26.0
37
-idna==3.18
38
-imagesize==2.0.0
39
-iniconfig==2.3.0
40
-Jinja2==3.1.6
41
-jiter==0.16.0
42
-joblib==1.5.3
43
-latex2mathml==3.81.0
44
-llama_cpp_python==0.3.34
45
-lxml==6.1.1
46
-markdown-it-py==4.2.0
47
-MarkupSafe==3.0.3
48
-mdurl==0.1.2
49
-modelscope==1.39.0
50
-modelscope-hub==0.2.0
51
-more-itertools==11.1.0
52
-mpmath==1.3.0
53
-multidict==6.7.1
54
-narwhals==2.24.0
55
-networkx==3.6.1
56
-numpy==2.3.5
57
-openai==2.53.0
58
-opencv-contrib-python==4.10.0.84
59
-opencv-python-headless==4.11.0.86
60
-openpyxl==3.1.5
61
-opt-einsum==3.3.0
62
-packaging==26.2
63
-paddleocr==3.7.0
1
+# Core
2
+typer>=0.15
3
+opencv-python-headless>=4.11
4
+numpy>=1.24,<2.4
5
+PyYAML>=6.0
6
+Pillow>=11.0
7
+requests>=2.32
8
+beautifulsoup4>=4.12
9
+
10
+# OCR engines
11
+paddlex>=3.2,<3.4
64 12
 paddlepaddle==3.2.2
65
-paddlex==3.7.2
66
-pandas==3.0.5
67
-pdftext==0.7.1
68
-pillow==10.4.0
69
-platformdirs==4.11.0
70
-pluggy==1.6.0
71
-premailer==3.10.0
72
-prettytable==3.18.0
73
-propcache==0.5.2
74
-protobuf==7.35.1
75
-psutil==7.2.2
76
-py-cpuinfo==9.0.0
77
-pyclipper==1.4.0
78
-pycryptodome==3.23.0
79
-pydantic==2.13.4
80
-pydantic-settings==2.14.2
81
-pydantic_core==2.46.4
82
-Pygments==2.20.0
83
-pypdfium2==5.10.1
84
-pytest==9.1.1
85
-python-bidi==0.6.11
86
-python-dateutil==2.9.0.post0
87
-python-dotenv==1.2.2
88
-PyYAML==6.0.2
89
-regex==2026.7.19
90
-requests==2.34.2
91
-rich==15.0.0
92
-ruamel.yaml==0.19.1
93
-ruff==0.16.1
94
-safetensors==0.8.0
95
-scikit-learn==1.9.0
96
-scipy==1.18.0
97
-sentencepiece==0.2.2
98
-setuptools==83.0.0
99
-shapely==2.1.2
100
-shellingham==1.5.4
101
-six==1.17.0
102
-sniffio==1.3.1
103
-soupsieve==2.9.1
104
-surya-ocr==0.22.1
105
-sympy==1.14.0
106
-threadpoolctl==3.6.0
107
-tiktoken==0.13.0
108
-tokenizers==0.22.2
109
-torch==2.13.0+cpu
110
-tqdm==4.70.0
111
-transformers==5.14.1
112
-typer==0.27.0
113
-typing-inspection==0.4.2
114
-typing_extensions==4.16.0
115
-ujson==5.13.0
116
-urllib3==2.7.0
117
-wcwidth==0.8.2
118
-yarl==1.24.5
13
+surya-ocr>=0.12
14
+
15
+# LLM corrector (--fix-by-llm)
16
+llama-cpp-python>=0.3
17
+
18
+# Dev
19
+pytest>=8.0
20
+ruff>=0.9

+ 0
- 3
src/latex/__init__.py 查看文件

@@ -1,3 +0,0 @@
1
-from src.latex.json_to_latex import json_to_html, json_to_latex, multi_json_to_latex
2
-
3
-__all__ = ["json_to_html", "json_to_latex", "multi_json_to_latex"]

+ 0
- 14
src/split/slicer.py 查看文件

@@ -267,20 +267,6 @@ def denoise_image(image: np.ndarray) -> np.ndarray:
267 267
     return cv2.fastNlMeansDenoisingColored(image, None, 10, 10, 7, 21)
268 268
 
269 269
 
270
-def binarize_image(image: np.ndarray) -> np.ndarray:
271
-    """Адаптивная бинаризация для неравномерной подсветки."""
272
-    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
273
-    binary = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C,
274
-                                    cv2.THRESH_BINARY, 31, 10)
275
-    return cv2.cvtColor(binary, cv2.COLOR_GRAY2BGR)
276
-
277
-
278
-def upscale_image(image: np.ndarray, factor: int = 2) -> np.ndarray:
279
-    """Увеличение для мелкого текста (бикубическая интерполяция)."""
280
-    h, w = image.shape[:2]
281
-    return cv2.resize(image, (w * factor, h * factor), interpolation=cv2.INTER_CUBIC)
282
-
283
-
284 270
 def process_image(
285 271
     input_path: Path,
286 272
     rows: int | None = None,

Loading…
取消
儲存