Skip to content
Snippets Groups Projects
Commit b7305617 authored by Manon Blanco's avatar Manon Blanco
Browse files

Remove add_eot and add_sot parameters from training configuration

parent c8bd6c91
No related branches found
No related tags found
1 merge request!161Remove add_eot and add_sot parameters from training configuration
......@@ -174,11 +174,9 @@ class OCRDataset(GenericDataset):
sample["label"] = full_label
sample["token_label"] = token_to_ind(self.charset, full_label)
if "add_eot" in self.params["config"]["constraints"]:
sample["token_label"].append(self.tokens["end"])
sample["token_label"].append(self.tokens["end"])
sample["label_len"] = len(sample["token_label"])
if "add_sot" in self.params["config"]["constraints"]:
sample["token_label"].insert(0, self.tokens["start"])
sample["token_label"].insert(0, self.tokens["start"])
return sample
......
......@@ -109,10 +109,7 @@ def get_config():
"height_divisor": 32, # Image height will be divided by 32
"padding_value": 0, # Image padding value
"padding_token": None, # Label padding value
"constraints": [
"add_eot",
"add_sot",
], # add end-of-transcription and start-of-transcription tokens in labels
"constraints": [],
"preprocessings": [
{
"type": "to_RGB",
......
......@@ -72,10 +72,7 @@ def training_config():
"height_divisor": 32, # Image height will be divided by 32
"padding_value": 0, # Image padding value
"padding_token": None, # Label padding value
"constraints": [
"add_eot",
"add_sot",
], # add end-of-transcription and start-of-transcription tokens in labels
"constraints": [],
"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