Skip to content

Commit a50616b

Browse files
myhloliCopilot
andauthored
Update mineru/utils/model_utils.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent da56746 commit a50616b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

mineru/utils/model_utils.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,22 @@ def remove_overlaps_min_blocks(res_list):
249249

250250

251251
def remove_overlaps_low_confidence_blocks(combined_res_list, overlap_threshold=0.8):
252+
"""
253+
Remove low-confidence blocks that overlap with other blocks.
254+
255+
This function identifies and removes blocks with low confidence scores that overlap
256+
with other blocks. It calculates the coordinates and area of each block, and checks
257+
for overlaps based on a specified threshold. Blocks that meet the criteria for removal
258+
are returned in a list.
259+
260+
Parameters:
261+
combined_res_list (list): A list of blocks, where each block is a dictionary containing
262+
keys like 'poly' (polygon coordinates) and optionally 'score' (confidence score).
263+
overlap_threshold (float): The threshold for determining overlap between blocks. Default is 0.8.
264+
265+
Returns:
266+
list: A list of blocks to be removed, based on the overlap and confidence criteria.
267+
"""
252268
# 计算每个block的坐标和面积
253269
block_info = []
254270
for block in combined_res_list:

0 commit comments

Comments
 (0)