Skip to content

Commit

Permalink
adjust parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
MulongXie committed Jul 5, 2021
1 parent 2ff7de7 commit f50d390
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 3 deletions.
Binary file modified detect_merge/__pycache__/merge.cpython-35.pyc
Binary file not shown.
3 changes: 1 addition & 2 deletions detect_merge/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ def refine_elements(compos, texts, intersection_bias=2, containment_ratio=0.8):


def remove_top_bar(elements, img_height):
height = img_height * 0.05
new_elements = []
for ele in elements:
if ele.row_min < height and ele.height < height:
if ele.row_min < 10 and ele.height < img_height * 0.05:
continue
new_elements.append(ele)
return new_elements
Expand Down
Binary file modified detect_text/__pycache__/text_detection.cpython-35.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion detect_text/text_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def text_cvt_orc_format(ocr_result):
def text_filter_noise(texts):
valid_texts = []
for text in texts:
if len(text.content) <= 1 and text.content.lower() not in ['a', ',', '.', '!', '?', '$', '%', ':']:
if len(text.content) <= 1 and text.content.lower() not in ['a', ',', '.', '!', '?', '$', '%', ':', '&']:
continue
valid_texts.append(text)
return valid_texts
Expand Down

0 comments on commit f50d390

Please sign in to comment.