Skip to content
Snippets Groups Projects
Commit 435fbdd5 authored by Manon Blanco's avatar Manon Blanco Committed by Mélodie Boillet
Browse files

Remove width_divisor and height_divisor parameters from training configuration

parent a93bc055
No related branches found
No related tags found
1 merge request!166Remove width_divisor and height_divisor parameters from training configuration
...@@ -77,9 +77,8 @@ class OCRDataset(GenericDataset): ...@@ -77,9 +77,8 @@ class OCRDataset(GenericDataset):
super(OCRDataset, self).__init__(params, set_name, custom_name, paths_and_sets) super(OCRDataset, self).__init__(params, set_name, custom_name, paths_and_sets)
self.charset = None self.charset = None
self.tokens = None self.tokens = None
self.reduce_dims_factor = np.array( # Factor to reduce the height and width of the feature vector before feeding the decoder.
[params["config"]["height_divisor"], params["config"]["width_divisor"], 1] self.reduce_dims_factor = np.array([32, 8, 1])
)
self.collate_function = OCRCollateFunction self.collate_function = OCRCollateFunction
def __getitem__(self, idx): def __getitem__(self, idx):
......
...@@ -105,8 +105,6 @@ def get_config(): ...@@ -105,8 +105,6 @@ def get_config():
"config": { "config": {
"load_in_memory": True, # Load all images in CPU memory "load_in_memory": True, # Load all images in CPU memory
"worker_per_gpu": 4, # Num of parallel processes per gpu for data loading "worker_per_gpu": 4, # Num of parallel processes per gpu for data loading
"width_divisor": 8, # Image width will be divided by 8
"height_divisor": 32, # Image height will be divided by 32
"padding_value": 0, # Image padding value "padding_value": 0, # Image padding value
"padding_token": None, # Label padding value "padding_token": None, # Label padding value
"preprocessings": [ "preprocessings": [
......
...@@ -14,8 +14,6 @@ All hyperparameters are specified and editable in the training scripts (meaning ...@@ -14,8 +14,6 @@ All hyperparameters are specified and editable in the training scripts (meaning
| `dataset_params.config.datasets` | Dataset dictionary with the dataset name as key and dataset path as value. | `dict` | | | `dataset_params.config.datasets` | Dataset dictionary with the dataset name as key and dataset path as value. | `dict` | |
| `dataset_params.config.load_in_memory` | Load all images in CPU memory. | `str` | `True` | | `dataset_params.config.load_in_memory` | Load all images in CPU memory. | `str` | `True` |
| `dataset_params.config.worker_per_gpu` | Number of parallel processes per gpu for data loading. | `int` | `4` | | `dataset_params.config.worker_per_gpu` | Number of parallel processes per gpu for data loading. | `int` | `4` |
| `dataset_params.config.height_divisor` | Factor to reduce the width of the feature vector before feeding the decoder. | `int` | `8` |
| `dataset_params.config.width_divisor` | Factor to reduce the height of the feature vector before feeding the decoder. | `int` | `32` |
| `dataset_params.config.padding_value` | Image padding value. | `int` | `0` | | `dataset_params.config.padding_value` | Image padding value. | `int` | `0` |
| `dataset_params.config.padding_token` | Transcription padding value. | `int` | `None` | | `dataset_params.config.padding_token` | Transcription padding value. | `int` | `None` |
| `dataset_params.config.preprocessings` | List of pre-processing functions to apply to input images. | `list` | (see [dedicated section](#data-preprocessing)) | | `dataset_params.config.preprocessings` | List of pre-processing functions to apply to input images. | `list` | (see [dedicated section](#data-preprocessing)) |
......
...@@ -68,8 +68,6 @@ def training_config(): ...@@ -68,8 +68,6 @@ def training_config():
}, },
"config": { "config": {
"load_in_memory": True, # Load all images in CPU memory "load_in_memory": True, # Load all images in CPU memory
"width_divisor": 8, # Image width will be divided by 8
"height_divisor": 32, # Image height will be divided by 32
"padding_value": 0, # Image padding value "padding_value": 0, # Image padding value
"padding_token": None, # Label padding value "padding_token": None, # Label padding value
"preprocessings": [ "preprocessings": [
......
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