Box
bbox_to_points ¶
scale_points ¶
union_points ¶
Return union bounding box of list of points
Source code in libs/kotaemon/kotaemon/loaders/utils/box.py
scale_box ¶
box_h ¶
box_w ¶
box_area ¶
get_rect_iou ¶
Intersection over union on layout rectangle
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gt_box
|
List[tuple]
|
List[tuple] A list contains bounding box coordinates of ground truth |
required |
pd_box
|
List[tuple]
|
List[tuple] A list contains bounding box coordinates of prediction |
required |
iou_type
|
int 0: intersection / union, normal IOU 1: intersection / min(areas), useful when boxes are under/over-segmented |
0
|
|
Input
|
format
|
[(x1, y1), (x2, y1), (x2, y2), (x1, y2)] |
required |
Annotation
|
for each element in bbox
|
|
required |
Returns:
Type | Description |
---|---|
int
|
Intersection over union value |
Source code in libs/kotaemon/kotaemon/loaders/utils/box.py
sort_funsd_reading_order ¶
Sort cell list to create the right reading order using their locations
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lines
|
List[dict]
|
list of cells to sort |
required |
Returns:
Type | Description |
---|---|
a list of cell lists in the right reading order that contain |
|
no key or start with a key and contain no other key |