Skip to content

Commit

Permalink
update and start imporving the final result
Browse files Browse the repository at this point in the history
  • Loading branch information
MulongXie committed Mar 4, 2020
1 parent 499f3fc commit 209e8be
Show file tree
Hide file tree
Showing 12 changed files with 5,010 additions and 307 deletions.
460 changes: 275 additions & 185 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Binary file modified __pycache__/merge.cpython-35.pyc
Binary file not shown.
115 changes: 0 additions & 115 deletions cnn/CNN.py

This file was deleted.

2 changes: 1 addition & 1 deletion config/CONFIG_UIED.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def __init__(self):
self.THRESHOLD_REC_MAX_DENT_RATIO = 0.25
self.THRESHOLD_LINE_THICKNESS = 8
self.THRESHOLD_LINE_MIN_LENGTH = 0.9
self.THRESHOLD_COMPO_MAX_SCALE = (0.1, 0.98) # (80/800, 422.5/450) maximum height and width ratio for a atomic compo (button)
self.THRESHOLD_COMPO_MAX_SCALE = (0.15, 0.98) # (120/800, 422.5/450) maximum height and width ratio for a atomic compo (button)
self.THRESHOLD_TEXT_MAX_WORD_GAP = 10
self.THRESHOLD_TEXT_MAX_HEIGHT = 0.04 # 40/800 maximum height of text
self.THRESHOLD_TOP_BOTTOM_BAR = (0.045, 0.94) # (36/800, 752/800) height ratio of top and bottom bar
Expand Down
Binary file modified config/__pycache__/CONFIG_UIED.cpython-35.pyc
Binary file not shown.
Binary file modified detect_compo/__pycache__/ip_region_proposal.cpython-35.pyc
Binary file not shown.
Binary file modified detect_compo/lib_ip/__pycache__/ip_detection.cpython-35.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion detect_compo/lib_ip/ip_detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def component_detection(binary,
print('Area:%d' % (len(region)))
draw.draw_boundary(compos_all, binary.shape, show=True)

# draw.draw_boundary(boundary_all, binary.shape, show=True)
# draw.draw_boundary(compos_all, binary.shape, show=True)
if rec_detect:
return compos_rec, compos_nonrec
else:
Expand Down
Binary file modified detect_text_east/__pycache__/ocr_east.cpython-35.pyc
Binary file not shown.
10 changes: 5 additions & 5 deletions main_select_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
classifier['Image'] = CNN('Image')
classifier['Elements'] = CNN('Elements')
# set the range of target inputs' indices
num = 1092
start_index = 2759
num = 4202
start_index = 65010 # 61728
end_index = 100000
for input_path_img in input_paths_img:
index = input_path_img.split('\\')[-1][:-4]
Expand All @@ -46,15 +46,15 @@

if is_ocr:
import ocr_east as ocr
ocr.east(input_path_img, output_root, resize_by_height=None, show=False, write_img=False)
ocr.east(input_path_img, output_root, resize_by_height=None, show=False, write_img=True)

if is_ip:
ip.compo_detection(input_path_img, output_root, num, resize_by_height=resize_by_height, show=True, classifier=classifier)
ip.compo_detection(input_path_img, output_root, num, resize_by_height=resize_by_height, show=False, classifier=classifier)

if is_merge:
import merge
compo_path = pjoin(output_root, 'ip', str(index) + '.json')
ocr_path = pjoin(output_root, 'ocr', str(index) + '.json')
merge.incorporate(input_path_img, compo_path, ocr_path, output_root, resize_by_height=resize_by_height, show=True)
merge.incorporate(input_path_img, compo_path, ocr_path, output_root, resize_by_height=resize_by_height, show=False, write_img=True)

num += 1
Empty file removed remaui.py
Empty file.
Loading

0 comments on commit 209e8be

Please sign in to comment.