Hayk Arutyunyan commited on
Commit ·
1dde15b
1
Parent(s): bd636c2
Fix ocr code
Browse files- src/ocr_utils_demo.py +1 -1
- src/pipeline_hf.py +0 -1
src/ocr_utils_demo.py
CHANGED
|
@@ -63,7 +63,7 @@ def ocr_sensors(rois: list[np.ndarray]):
|
|
| 63 |
for roi in rois:
|
| 64 |
try:
|
| 65 |
ocr_res = paddle_ocr.ocr(roi, det=False, cls=False)
|
| 66 |
-
print(ocr_res) # для отладки
|
| 67 |
except Exception as e:
|
| 68 |
print(f"⚠ Ошибка OCR.ocr: {e}")
|
| 69 |
results.append({"text": "?", "score": 0.0})
|
|
|
|
| 63 |
for roi in rois:
|
| 64 |
try:
|
| 65 |
ocr_res = paddle_ocr.ocr(roi, det=False, cls=False)
|
| 66 |
+
print(f"Результат оцифровки: {ocr_res}") # для отладки
|
| 67 |
except Exception as e:
|
| 68 |
print(f"⚠ Ошибка OCR.ocr: {e}")
|
| 69 |
results.append({"text": "?", "score": 0.0})
|
src/pipeline_hf.py
CHANGED
|
@@ -53,7 +53,6 @@ def process_single_image(img: np.ndarray, color_ranges: dict):
|
|
| 53 |
sensors = []
|
| 54 |
if rois:
|
| 55 |
ocr_results = ocr_sensors(rois)
|
| 56 |
-
print(ocr_results) # для отладки
|
| 57 |
|
| 58 |
for (x, y, ww, hh), result in zip(positions, ocr_results):
|
| 59 |
sensors.append({
|
|
|
|
| 53 |
sensors = []
|
| 54 |
if rois:
|
| 55 |
ocr_results = ocr_sensors(rois)
|
|
|
|
| 56 |
|
| 57 |
for (x, y, ww, hh), result in zip(positions, ocr_results):
|
| 58 |
sensors.append({
|