diff --git a/klausur-service/backend/cv_words_first.py b/klausur-service/backend/cv_words_first.py index e386139..f1ca0bc 100644 --- a/klausur-service/backend/cv_words_first.py +++ b/klausur-service/backend/cv_words_first.py @@ -181,15 +181,15 @@ def _build_cells( confs = [w.get('conf', 0) for w in cell_words if w.get('conf', 0) > 0] avg_conf = sum(confs) / len(confs) if confs else 0.0 - # Word boxes with percent coordinates + # Word boxes with absolute pixel coordinates (consistent with cv_cell_grid.py) word_boxes = [] for w in sorted(cell_words, key=lambda ww: (ww['top'], ww['left'])): word_boxes.append({ 'text': w.get('text', ''), - 'left': round(w['left'] / img_w * 100, 2) if img_w else 0, - 'top': round(w['top'] / img_h * 100, 2) if img_h else 0, - 'width': round(w['width'] / img_w * 100, 2) if img_w else 0, - 'height': round(w['height'] / img_h * 100, 2) if img_h else 0, + 'left': w['left'], + 'top': w['top'], + 'width': w['width'], + 'height': w['height'], 'conf': w.get('conf', 0), })