edspdf.utils.alignment
align_box_labels(src_boxes, dst_boxes, threshold=0.0001, group_by_source=False, pollution_label=None)
Align lines with possibly overlapping (and non-exhaustive) labels.
Possible matches are sorted by covered area. Lines with no overlap at all
| PARAMETER | DESCRIPTION |
|---|---|
src_boxes |
The labelled boxes that will be used to determine the label of the dst_boxes
TYPE:
|
dst_boxes |
The non-labelled boxes that will be assigned a label
TYPE:
|
group_by_source |
Whether to perform majority voting between different sources of annotations if any
TYPE:
|
threshold |
Threshold to use for discounting a label. Used if the
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
List[Box]
|
A copy of the boxes, with the labels mapped from the source boxes |
Source code in edspdf/utils/alignment.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |