Hayk Arutyunyan commited on
Commit ·
0e66bfe
1
Parent(s): fde7f25
Add print for roi and ocr_results
Browse files- src/pipeline_hf.py +2 -1
src/pipeline_hf.py
CHANGED
|
@@ -42,6 +42,7 @@ def process_single_image(img: np.ndarray, color_ranges: dict):
|
|
| 42 |
roi = img[y:y + hh_clamped, x:x + ww]
|
| 43 |
rois.append(roi)
|
| 44 |
positions.append((x, y, ww, hh))
|
|
|
|
| 45 |
|
| 46 |
# ---------- 3. OCR сенсоров ----------
|
| 47 |
sensors = []
|
|
@@ -78,7 +79,7 @@ def process_image_to_excel(cfg: dict):
|
|
| 78 |
for img_path in input_dir.glob("*.png"):
|
| 79 |
name = img_path.name
|
| 80 |
img = cv2.imread(str(img_path))
|
| 81 |
-
|
| 82 |
if img is None:
|
| 83 |
print(f"Не могу прочитать файл {name}")
|
| 84 |
continue
|
|
|
|
| 42 |
roi = img[y:y + hh_clamped, x:x + ww]
|
| 43 |
rois.append(roi)
|
| 44 |
positions.append((x, y, ww, hh))
|
| 45 |
+
print(rois) # для отладки
|
| 46 |
|
| 47 |
# ---------- 3. OCR сенсоров ----------
|
| 48 |
sensors = []
|
|
|
|
| 79 |
for img_path in input_dir.glob("*.png"):
|
| 80 |
name = img_path.name
|
| 81 |
img = cv2.imread(str(img_path))
|
| 82 |
+
|
| 83 |
if img is None:
|
| 84 |
print(f"Не могу прочитать файл {name}")
|
| 85 |
continue
|