Commit 80c04ca7 authored by liukaiwen's avatar liukaiwen

更新了magic_model

parent 7da3b545
...@@ -419,7 +419,7 @@ class MagicModel: ...@@ -419,7 +419,7 @@ class MagicModel:
page_h = page.rect.height page_h = page.rect.height
return page_w, page_h return page_w, page_h
def __get_blocks_by_type(self, types: list, page_no: int, extra_col: list[str] = []) -> list: def __get_blocks_by_type(self, type: int, page_no: int, extra_col: list[str] = []) -> list:
blocks = [] blocks = []
for page_dict in self.__model_list: for page_dict in self.__model_list:
layout_dets = page_dict.get("layout_dets", []) layout_dets = page_dict.get("layout_dets", [])
...@@ -431,7 +431,7 @@ class MagicModel: ...@@ -431,7 +431,7 @@ class MagicModel:
category_id = item.get("category_id", -1) category_id = item.get("category_id", -1)
bbox = item.get("bbox", None) bbox = item.get("bbox", None)
if category_id in types: if category_id == type:
block = { block = {
"bbox": bbox "bbox": bbox
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment