Skip to content

Commit 8893406

Browse files
fix: Use plain int python type for num_pixels
Signed-off-by: Nikos Livathinos <nli@zurich.ibm.com>
1 parent c75e59f commit 8893406

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

docling_eval/evaluators/pixel/confusion_matrix_exporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def __init__(
107107
def build_ds_report(
108108
self,
109109
num_images: int,
110-
num_pixels: np.uint64,
110+
num_pixels: int,
111111
headers: list[str],
112112
matrix_evaluation: MultiLabelMatrixEvaluation,
113113
collapsed_headers: list[str],

docling_eval/evaluators/pixel/pixel_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class PagePixelLayoutEvaluation(BaseModel):
7575
class DatasetPixelLayoutEvaluation(BaseModel):
7676
layout_model_name: Optional[str]
7777
num_pages: int
78-
num_pixels: np.uint64
78+
num_pixels: int
7979
rejected_samples: Dict[EvaluationRejectionType, int]
8080
matrix_evaluation: MultiLabelMatrixEvaluation
8181
page_evaluations: Dict[str, PagePixelLayoutEvaluation]

docling_eval/evaluators/pixel_layout_evaluator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def __call__(
196196
all_pages_evaluations: Dict[str, PagePixelLayoutEvaluation] = (
197197
{}
198198
) # Key is doc_id-page-no
199-
ds_num_pixels: np.uint64 = np.uint64(0)
199+
ds_num_pixels = 0
200200
self._layout_model_name = None
201201
pages_detailed_f1: list[float] = (
202202
[]
@@ -385,7 +385,7 @@ def _compute_document_confusion_matrix(
385385
pred_doc: DoclingDocument,
386386
) -> Tuple[
387387
Dict[int, np.ndarray], # page_no -> page confusion matrix
388-
np.uint64, # num_pixels
388+
int, # num_pixels
389389
]:
390390
r"""
391391
Compute the confusion matrix for the given documents.
@@ -405,7 +405,7 @@ def _compute_document_confusion_matrix(
405405
num_categories = len(matrix_categories_ids)
406406
off_diagonal_cells = num_categories * num_categories - num_categories
407407
page_confusion_matrices: Dict[int, np.ndarray] = {}
408-
num_pixels: np.uint64 = np.uint64(0)
408+
num_pixels = 0
409409

410410
for page_no in sorted(gt_pages):
411411
page_size = true_doc.pages[page_no].size

0 commit comments

Comments
 (0)