From 0f97e2444d68e1a02ec5d390aaf53abd2d650281 Mon Sep 17 00:00:00 2001
From: Nolan <nboukachab@teklia.com>
Date: Tue, 23 May 2023 13:02:22 +0000
Subject: [PATCH] Remove raw_line_seg_label, paragraphs_label, pages_label

---
 dan/manager/dataset.py | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/dan/manager/dataset.py b/dan/manager/dataset.py
index b93cae10..2b28e6dc 100644
--- a/dan/manager/dataset.py
+++ b/dan/manager/dataset.py
@@ -272,13 +272,6 @@ class GenericDataset(Dataset):
                 )
                 if load_in_memory:
                     samples[-1]["img"] = GenericDataset.load_image(filename)
-                if type(gt[filename]) is dict:
-                    if "lines" in gt[filename].keys():
-                        samples[-1]["raw_line_seg_label"] = gt[filename]["lines"]
-                    if "paragraphs" in gt[filename].keys():
-                        samples[-1]["paragraphs_label"] = gt[filename]["paragraphs"]
-                    if "pages" in gt[filename].keys():
-                        samples[-1]["pages_label"] = gt[filename]["pages"]
         return samples
 
     def apply_preprocessing(self, preprocessings):
@@ -421,15 +414,6 @@ def apply_preprocessing(sample, preprocessings):
                 temp_img = np.expand_dims(temp_img, axis=2)
             img = temp_img
             resize_ratio = [ratio, ratio]
-    if resize_ratio != [1, 1] and "raw_line_seg_label" in sample:
-        for li in range(len(sample["raw_line_seg_label"])):
-            for side, ratio in zip(
-                (["bottom", "top"], ["right", "left"]), resize_ratio
-            ):
-                for s in side:
-                    sample["raw_line_seg_label"][li][s] = (
-                        sample["raw_line_seg_label"][li][s] * ratio
-                    )
 
     sample["img"] = img
     sample["resize_ratio"] = resize_ratio
-- 
GitLab