Skip to content

Commit

Permalink
fix bugs in merge-intersection
Browse files Browse the repository at this point in the history
  • Loading branch information
MulongXie committed Aug 8, 2020
1 parent bd19af6 commit 0a323a8
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 130 deletions.
Binary file modified __pycache__/merge.cpython-35.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion config/CONFIG.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self):
'RatingBar': (0, 166, 255), 'SeekBar': (0, 166, 10), 'Spinner': (50, 21, 255),
'Switch': (80, 166, 66), 'ToggleButton': (0, 66, 80), 'VideoView': (88, 66, 0),
'TextView': (169, 255, 0), 'NonText': (0,0,255),
'Compo':(0, 0, 255), 'Text':(169, 255, 0)}
'Compo':(0, 0, 255), 'Text':(169, 255, 0), 'Block':(80, 166, 66)}

def build_output_folders(self):
# setting data flow paths
Expand Down
Binary file modified config/__pycache__/CONFIG.cpython-35.pyc
Binary file not shown.
Binary file added data/output/clips/Block/19.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified data/output/clips/bkg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
264 changes: 137 additions & 127 deletions data/output/compo.json
Original file line number Diff line number Diff line change
@@ -1,211 +1,221 @@
{
"img": {
"shape": [
800,
494,
3
]
},
"compos": [
{
"column_min": 0,
"row_max": 800,
"class": "Background",
"column_max": 494,
"row_min": 0,
"id": 0,
"height": 800,
"class": "Background",
"width": 494,
"row_min": 0,
"row_max": 800,
"column_min": 0
"width": 494
},
{
"column_max": 98,
"id": 0,
"height": 15,
"column_min": 25,
"row_max": 33,
"class": "Text",
"width": 73,
"height": 15,
"column_max": 98,
"row_min": 18,
"row_max": 33,
"column_min": 25
"id": 0,
"width": 73
},
{
"column_max": 200,
"id": 1,
"height": 15,
"column_min": 168,
"row_max": 33,
"class": "Text",
"width": 32,
"height": 15,
"column_max": 200,
"row_min": 18,
"row_max": 33,
"column_min": 168
"id": 1,
"width": 32
},
{
"column_max": 350,
"id": 2,
"height": 15,
"column_min": 266,
"row_max": 33,
"class": "Text",
"width": 84,
"height": 15,
"column_max": 350,
"row_min": 18,
"row_max": 33,
"column_min": 266
"id": 2,
"width": 84
},
{
"column_max": 453,
"id": 3,
"height": 15,
"column_min": 410,
"row_max": 33,
"class": "Text",
"width": 43,
"height": 15,
"column_max": 453,
"row_min": 18,
"row_max": 33,
"column_min": 410
"id": 3,
"width": 43
},
{
"column_max": 492,
"id": 4,
"height": 195,
"column_min": 0,
"row_max": 239,
"class": "Compo",
"width": 492,
"height": 195,
"column_max": 492,
"row_min": 44,
"row_max": 239,
"column_min": 0
"id": 4,
"width": 492
},
{
"column_max": 313,
"id": 5,
"height": 26,
"column_min": 180,
"row_max": 300,
"class": "Text",
"width": 133,
"height": 26,
"column_max": 313,
"row_min": 274,
"row_max": 300,
"column_min": 180
"id": 5,
"width": 133
},
{
"column_max": 244,
"id": 6,
"height": 175,
"column_min": 6,
"row_max": 497,
"class": "Compo",
"width": 238,
"height": 175,
"column_max": 244,
"row_min": 322,
"row_max": 497,
"column_min": 6
"id": 6,
"width": 238
},
{
"column_max": 486,
"id": 7,
"height": 175,
"column_min": 248,
"row_max": 497,
"class": "Compo",
"width": 238,
"height": 175,
"column_max": 486,
"row_min": 322,
"row_max": 497,
"column_min": 248
"id": 7,
"width": 238
},
{
"column_max": 161,
"id": 8,
"height": 26,
"column_min": 141,
"row_max": 538,
"class": "Compo",
"width": 20,
"height": 26,
"column_max": 161,
"row_min": 512,
"row_max": 538,
"column_min": 141
"id": 8,
"width": 20
},
{
"column_max": 483,
"id": 9,
"height": 24,
"column_min": 383,
"row_max": 538,
"class": "Text",
"width": 100,
"height": 24,
"column_max": 483,
"row_min": 514,
"row_max": 538,
"column_min": 383
"id": 9,
"width": 100
},
{
"column_max": 43,
"id": 10,
"height": 17,
"column_min": 9,
"row_max": 534,
"class": "Text",
"width": 34,
"height": 17,
"column_max": 43,
"row_min": 517,
"row_max": 534,
"column_min": 9
"id": 10,
"width": 34
},
{
"column_max": 241,
"id": 11,
"height": 19,
"column_min": 166,
"row_max": 535,
"class": "Text",
"width": 75,
"height": 19,
"column_max": 241,
"row_min": 516,
"row_max": 535,
"column_min": 166
"id": 11,
"width": 75
},
{
"column_max": 284,
"id": 12,
"height": 16,
"column_min": 251,
"row_max": 534,
"class": "Text",
"width": 33,
"height": 16,
"column_max": 284,
"row_min": 518,
"row_max": 534,
"column_min": 251
"id": 12,
"width": 33
},
{
"column_max": 244,
"id": 13,
"height": 176,
"column_min": 6,
"row_max": 729,
"class": "Compo",
"width": 238,
"height": 176,
"column_max": 244,
"row_min": 553,
"row_max": 729,
"column_min": 6
"id": 13,
"width": 238
},
{
"column_max": 486,
"id": 14,
"height": 176,
"column_min": 248,
"row_max": 729,
"class": "Compo",
"width": 238,
"height": 176,
"column_max": 486,
"row_min": 553,
"row_max": 729,
"column_min": 248
"id": 14,
"width": 238
},
{
"column_max": 137,
"id": 15,
"height": 23,
"column_min": 109,
"row_max": 769,
"class": "Compo",
"width": 28,
"height": 23,
"column_max": 137,
"row_min": 746,
"row_max": 769,
"column_min": 109
"id": 15,
"width": 28
},
{
"column_max": 383,
"id": 16,
"height": 25,
"column_min": 356,
"row_max": 769,
"class": "Compo",
"width": 27,
"height": 25,
"column_max": 383,
"row_min": 744,
"row_max": 769,
"column_min": 356
"id": 16,
"width": 27
},
{
"column_max": 150,
"id": 17,
"height": 15,
"column_min": 94,
"row_max": 791,
"class": "Text",
"width": 56,
"height": 15,
"column_max": 150,
"row_min": 776,
"row_max": 791,
"column_min": 94
"id": 17,
"width": 56
},
{
"column_max": 398,
"id": 18,
"height": 15,
"column_min": 343,
"row_max": 791,
"class": "Text",
"width": 55,
"height": 15,
"column_max": 398,
"row_min": 776,
"row_max": 791,
"column_min": 343
"id": 18,
"width": 55
},
{
"column_min": 208,
"row_max": 235,
"class": "Block",
"height": 103,
"column_max": 397,
"row_min": 132,
"id": 19,
"width": 189
}
],
"img": {
"shape": [
800,
494,
3
]
}
]
}
Binary file modified data/output/result.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ -34,7 +34,7 @@ def merge_intersected_corner(compos, org, max_gap=(0, 0), max_ele_height=25):
if not changed:
return compos
else:
return merge_intersected_corner(new_compos, org)
return merge_intersected_corner(new_compos, org, max_gap, max_ele_height)


def merge_text(compos, org_shape, max_word_gad=4, max_word_height=20):
Expand Down
2 changes: 1 addition & 1 deletion merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def merge_intersected_compos(org, compos, max_gap=(0, 0), merge_class=None):
if not changed:
return compos
else:
return merge_intersected_compos(org, new_compos)
return merge_intersected_compos(org, new_compos, max_gap, merge_class)


def incorporate(img_path, compo_path, text_path, output_root, resize_by_height=None, show=False):
Expand Down

0 comments on commit 0a323a8

Please sign in to comment.