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

Update labels.json parsing during training

parent 537fcddf
No related branches found
No related tags found
1 merge request!269Update labels.json parsing during training
......@@ -95,15 +95,11 @@ class OCRDataset(Dataset):
set_name = path_and_set["set_name"]
gt = gt_per_set[set_name]
for filename in natural_sort(gt):
if isinstance(gt[filename], dict) and "text" in gt[filename]:
label = gt[filename]["text"]
else:
label = gt[filename]
filepath = Path(filename)
samples.append(
{
"name": filepath.name,
"label": label,
"label": gt[filename],
"path": filepath.resolve(),
}
)
......
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