Skip to content
Snippets Groups Projects

Fix parsing of labels.json when generating stats

Merged Yoann Schneider requested to merge fix-stats-parsing into main
2 files
+ 7
21
Compare changes
  • Side-by-side
  • Inline
Files
2
# -*- coding: utf-8 -*-
from collections import Counter, defaultdict
from operator import itemgetter
from pathlib import Path
from typing import Dict, List, Optional
@@ -156,8 +155,7 @@ class Statistics:
# Path to the images are the key of the dict
self.create_image_statistics(images=split_data.keys())
# The text is actually under the "text" key of the values
labels = list(map(itemgetter("text"), split_data.values()))
labels = list(split_data.values())
# Text statistics
self.create_label_statistics(labels=labels)
Loading