diff --git a/dan/manager/ocr.py b/dan/manager/ocr.py index d15627804241cd1761cac8c3a793d1458067ee3d..b70b9364bad373acf6ceb09bd5d4e5f3b453a700 100644 --- a/dan/manager/ocr.py +++ b/dan/manager/ocr.py @@ -112,9 +112,8 @@ class OCRDataset(GenericDataset): ) sample["img"] = cv2.resize(sample["img"], (new_w, new_h)) - # Normalization if requested - if "normalize" in self.params["config"] and self.params["config"]["normalize"]: - sample["img"] = (sample["img"] - self.mean) / self.std + # Normalization + sample["img"] = (sample["img"] - self.mean) / self.std sample["img_reduced_shape"] = np.ceil( sample["img"].shape / self.reduce_dims_factor diff --git a/dan/ocr/document/train.py b/dan/ocr/document/train.py index 4745fb97709e9b83a35750ffc646c474d74742ea..a3bbba555dd526e70c6e1929a3c09fc5b12f0c5b 100644 --- a/dan/ocr/document/train.py +++ b/dan/ocr/document/train.py @@ -113,7 +113,6 @@ def get_config(): "add_eot", "add_sot", ], # add end-of-transcription and start-of-transcription tokens in labels - "normalize": True, # Normalize with mean and variance of training dataset "preprocessings": [ { "type": "to_RGB", diff --git a/docs/usage/train/parameters.md b/docs/usage/train/parameters.md index 7447e082b23ce35af67ace5203f91079fea4e788..9c82931bdc9c80715f9768712fbacd0e963c3000 100644 --- a/docs/usage/train/parameters.md +++ b/docs/usage/train/parameters.md @@ -19,7 +19,6 @@ All hyperparameters are specified and editable in the training scripts (meaning | `dataset_params.config.padding_value` | Image padding value. | `int` | `0` | | `dataset_params.config.padding_token` | Transcription padding value. | `int` | `None` | | `dataset_params.config.constraints` | Whether to add end-of-transcription and start-of-transcription tokens in labels. | `list` | `["add_eot", "add_sot"]` | -| `dataset_params.config.normalize` | Normalize with mean and variance of training dataset. | `bool` | `True` | | `dataset_params.config.preprocessings` | List of pre-processing functions to apply to input images. | `list` | (see [dedicated section](#data-preprocessing)) | | `dataset_params.config.augmentation` | Configuration for data augmentation. | `dict` | (see [dedicated section](#data-augmentation)) | diff --git a/tests/conftest.py b/tests/conftest.py index 7febae99ce0519725f2d8a77d1c2c9b32321dd16..854de3c0528b2df1cdecd53fbfd3e7b9e37f5092 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -76,7 +76,6 @@ def training_config(): "add_eot", "add_sot", ], # add end-of-transcription and start-of-transcription tokens in labels - "normalize": True, # Normalize with mean and variance of training dataset "preprocessings": [ { "type": "to_RGB",