From 6230cb863e9eeefb75701030ece2efae5a603506 Mon Sep 17 00:00:00 2001 From: manonBlanco <blanco@teklia.com> Date: Tue, 13 Jun 2023 10:41:20 +0200 Subject: [PATCH] Remove DPI adjustment from the data preprocessing --- dan/manager/dataset.py | 13 ------------- docs/usage/train/parameters.md | 8 -------- 2 files changed, 21 deletions(-) diff --git a/dan/manager/dataset.py b/dan/manager/dataset.py index 9d987c68..0b3904e7 100644 --- a/dan/manager/dataset.py +++ b/dan/manager/dataset.py @@ -355,19 +355,6 @@ def apply_preprocessing(sample, preprocessings): resize_ratio = [1, 1] img = sample["img"] for preprocessing in preprocessings: - if preprocessing["type"] == "dpi": - ratio = preprocessing["target"] / preprocessing["source"] - temp_img = img - h, w, c = temp_img.shape - temp_img = cv2.resize( - temp_img, (int(np.ceil(w * ratio)), int(np.ceil(h * ratio))) - ) - if len(temp_img.shape) == 2: - temp_img = np.expand_dims(temp_img, axis=2) - img = temp_img - - resize_ratio = [ratio, ratio] - if preprocessing["type"] == "to_grayscaled": temp_img = img h, w, c = temp_img.shape diff --git a/docs/usage/train/parameters.md b/docs/usage/train/parameters.md index e1dc0736..afd71f94 100644 --- a/docs/usage/train/parameters.md +++ b/docs/usage/train/parameters.md @@ -28,14 +28,6 @@ All hyperparameters are specified and editable in the training scripts (meaning Preprocessing is applied before training the network (see `dan/manager/dataset.py`). The following transformations are implemented: -* DPI adjustment -```py - { - "type": "dpi", - "source": 300, - "target": 150, - } -``` * Convert to grayscale ```py { -- GitLab