Browse Source

Merge pull request #58 from myhloli/master

模型数据初始化时根据置信度进行过滤,预设阈值95%
myhloli 1 year ago
parent
commit
46c5d6e081
1 changed files with 2 additions and 3 deletions
  1. 2 3
      magic_pdf/model/magic_model.py

+ 2 - 3
magic_pdf/model/magic_model.py

@@ -48,7 +48,7 @@ class MagicModel:
             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
@@ -59,8 +59,7 @@ class MagicModel:
         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)