File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,20 @@ class SemClass(str, Enum):
110110DEFAULT_CONTAINMENT_THRESH : float = 0.50
111111DEFAULT_SEM_MATCH_IOU : float = 0.30
112112
113+ pic_classes = {
114+ "BARCODE" : "bar_code" ,
115+ "CHART" : "chart" ,
116+ "DECORATION" : "decoration" ,
117+ "ILLUSTRATION" : "illustration" ,
118+ "INFOGRAPHIC" : "infographic" ,
119+ "LOGO" : "logo" ,
120+ "OTHER" : "other" ,
121+ "PERSON" : "person" ,
122+ "PICTOGRAM" : "icon" ,
123+ "SCREENSHOT" : "screenshot" ,
124+ "UI_ELEMENT" : "ui_element" ,
125+ }
126+
113127
114128@dataclass (frozen = True )
115129class Cell :
@@ -1475,12 +1489,14 @@ def _create_item_by_label(
14751489
14761490 if element .type is not None :
14771491 pic_class = element .type
1492+ pic_class_harmonized = pic_classes [pic_class ]
1493+
14781494 pic_item .annotations .append (
14791495 PictureClassificationData (
14801496 provenance = "human" ,
14811497 predicted_classes = [
14821498 PictureClassificationClass (
1483- class_name = pic_class , confidence = 1.0
1499+ class_name = pic_class_harmonized , confidence = 1.0
14841500 )
14851501 ],
14861502 )
You can’t perform that action at this time.
0 commit comments