Skip to content
Snippets Groups Projects
Commit 2cbbfb7a authored by Mélodie's avatar Mélodie
Browse files

Apply c559d8ef

parent 52bc1f2a
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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",
......
......@@ -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)) |
......
......@@ -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",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment