Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

模型数据初始化时根据置信度进行过滤,预设阈值95% #58

Merged
merged 1 commit into from
Apr 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions magic_pdf/model/magic_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __fix_by_confidence(self):
need_remove_list = []
layout_dets = model_page_info["layout_dets"]
for layout_det in layout_dets:
if layout_det["score"] < 0.6:
if layout_det["score"] < 0.95:
need_remove_list.append(layout_det)
else:
continue
Expand All @@ -59,8 +59,7 @@ def __init__(self, model_list: list, docs: fitz.Document):
self.__model_list = model_list
self.__docs = docs
self.__fix_axis()
#@TODO 删除掉一些低置信度的会导致分段错误,后面再修复
# self.__fix_by_confidence()
self.__fix_by_confidence()

def __reduct_overlap(self, bboxes):
N = len(bboxes)
Expand Down
Loading