diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 1670f9c..b2c9fcd 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -6,6 +6,14 @@ + + + + + + + + @@ -321,7 +330,7 @@ - + diff --git a/config/__pycache__/CONFIG_UIED.cpython-35.pyc b/config/__pycache__/CONFIG_UIED.cpython-35.pyc index 4a20f50..0675fb2 100644 Binary files a/config/__pycache__/CONFIG_UIED.cpython-35.pyc and b/config/__pycache__/CONFIG_UIED.cpython-35.pyc differ diff --git a/data/output/ip/497.jpg b/data/output/ip/497.jpg index 95c9bca..29f10b3 100644 Binary files a/data/output/ip/497.jpg and b/data/output/ip/497.jpg differ diff --git a/data/output/ip/497.json b/data/output/ip/497.json index 6027bbe..3347b5a 100644 --- a/data/output/ip/497.json +++ b/data/output/ip/497.json @@ -1,1059 +1,1059 @@ { - "img_shape": [ - 800, - 450, - 3 - ], "compos": [ { + "height": 18, + "row_max": 22, + "column_min": 63, "id": 1, "width": 16, "class": "Compo", "column_max": 79, - "column_min": 63, - "height": 18, - "row_min": 4, - "row_max": 22 + "row_min": 4 }, { + "height": 19, + "row_max": 23, + "column_min": 140, "id": 2, - "width": 16, - "class": "Compo", - "column_max": 106, - "column_min": 90, - "height": 17, - "row_min": 4, - "row_max": 21 - }, - { - "id": 3, "width": 19, "class": "Compo", "column_max": 159, - "column_min": 140, - "height": 19, - "row_min": 4, - "row_max": 23 + "row_min": 4 }, { - "id": 4, + "height": 16, + "row_max": 21, + "column_min": 170, + "id": 3, "width": 12, "class": "Compo", "column_max": 182, - "column_min": 170, - "height": 16, - "row_min": 5, - "row_max": 21 + "row_min": 5 }, { - "id": 5, + "height": 16, + "row_max": 20, + "column_min": 196, + "id": 4, "width": 13, "class": "Compo", "column_max": 209, - "column_min": 196, - "height": 16, - "row_min": 4, - "row_max": 20 + "row_min": 4 }, { - "id": 6, + "height": 17, + "row_max": 21, + "column_min": 323, + "id": 5, "width": 11, "class": "Compo", "column_max": 334, - "column_min": 323, - "height": 17, - "row_min": 4, - "row_max": 21 + "row_min": 4 }, { - "id": 7, + "height": 17, + "row_max": 22, + "column_min": 341, + "id": 6, "width": 21, "class": "Compo", "column_max": 362, - "column_min": 341, - "height": 17, - "row_min": 5, - "row_max": 22 + "row_min": 5 }, { - "id": 8, + "height": 17, + "row_max": 21, + "column_min": 367, + "id": 7, "width": 15, "class": "Compo", "column_max": 382, - "column_min": 367, - "height": 17, - "row_min": 4, - "row_max": 21 + "row_min": 4 }, { - "id": 9, + "height": 17, + "row_max": 22, + "column_min": 390, + "id": 8, "width": 12, "class": "Compo", "column_max": 402, - "column_min": 390, - "height": 17, - "row_min": 5, - "row_max": 22 + "row_min": 5 }, { - "id": 10, + "height": 17, + "row_max": 23, + "column_min": 11, + "id": 9, "width": 16, "class": "Compo", "column_max": 27, - "column_min": 11, - "height": 17, - "row_min": 6, - "row_max": 23 + "row_min": 6 }, { - "id": 11, + "height": 17, + "row_max": 23, + "column_min": 38, + "id": 10, "width": 14, "class": "Compo", "column_max": 52, - "column_min": 38, - "height": 19, - "row_min": 4, - "row_max": 23 + "row_min": 6 }, { + "height": 15, + "row_max": 21, + "column_min": 90, + "id": 11, + "width": 16, + "class": "Compo", + "column_max": 106, + "row_min": 6 + }, + { + "height": 14, + "row_max": 20, + "column_min": 117, "id": 12, "width": 14, "class": "Compo", "column_max": 131, - "column_min": 117, - "height": 14, - "row_min": 6, - "row_max": 20 + "row_min": 6 }, { + "height": 12, + "row_max": 20, + "column_min": 410, "id": 13, "width": 12, "class": "Compo", "column_max": 422, - "column_min": 410, - "height": 12, - "row_min": 8, - "row_max": 20 + "row_min": 8 }, { + "height": 12, + "row_max": 20, + "column_min": 423, "id": 14, "width": 17, "class": "Compo", "column_max": 440, - "column_min": 423, - "height": 12, - "row_min": 8, - "row_max": 20 + "row_min": 8 }, { + "height": 39, + "row_max": 73, + "column_min": 10, "id": 15, "width": 369, "class": "Compo", "column_max": 379, - "column_min": 10, - "height": 39, - "row_min": 34, - "row_max": 73 + "row_min": 34 }, { + "height": 15, + "row_max": 62, + "column_min": 385, "id": 16, "width": 53, "class": "Compo", "column_max": 438, - "column_min": 385, - "height": 15, - "row_min": 47, - "row_max": 62 + "row_min": 47 }, { + "height": 62, + "row_max": 153, + "column_min": 21, "id": 17, - "width": 68, + "width": 67, "class": "Compo", "column_max": 88, - "column_min": 20, - "height": 62, - "row_min": 91, - "row_max": 153 + "row_min": 91 }, { + "height": 14, + "row_max": 114, + "column_min": 93, "id": 18, "width": 35, "class": "Compo", "column_max": 128, - "column_min": 93, - "height": 14, - "row_min": 100, - "row_max": 114 + "row_min": 100 }, { + "height": 14, + "row_max": 114, + "column_min": 216, "id": 19, "width": 39, "class": "Compo", "column_max": 255, - "column_min": 216, - "height": 14, - "row_min": 100, - "row_max": 114 + "row_min": 100 }, { + "height": 13, + "row_max": 114, + "column_min": 129, "id": 20, "width": 29, "class": "Compo", "column_max": 158, - "column_min": 129, - "height": 13, - "row_min": 101, - "row_max": 114 + "row_min": 101 }, { + "height": 13, + "row_max": 114, + "column_min": 160, "id": 21, "width": 52, "class": "Compo", "column_max": 212, - "column_min": 160, - "height": 13, - "row_min": 101, - "row_max": 114 + "row_min": 101 }, { + "height": 12, + "row_max": 140, + "column_min": 93, "id": 22, "width": 44, "class": "Compo", "column_max": 137, - "column_min": 93, - "height": 12, - "row_min": 128, - "row_max": 140 + "row_min": 128 }, { + "height": 12, + "row_max": 140, + "column_min": 156, "id": 23, "width": 9, "class": "Compo", "column_max": 165, - "column_min": 156, - "height": 12, - "row_min": 128, - "row_max": 140 + "row_min": 128 }, { + "height": 10, + "row_max": 140, + "column_min": 170, "id": 24, "width": 32, "class": "Compo", "column_max": 202, - "column_min": 170, - "height": 10, - "row_min": 130, - "row_max": 140 + "row_min": 130 }, { + "height": 66, + "row_max": 230, + "column_min": 21, "id": 25, "width": 67, "class": "Compo", "column_max": 88, - "column_min": 21, - "height": 66, - "row_min": 164, - "row_max": 230 + "row_min": 164 }, { + "height": 15, + "row_max": 193, + "column_min": 92, "id": 26, "width": 37, "class": "Compo", "column_max": 129, - "column_min": 92, - "height": 15, - "row_min": 178, - "row_max": 193 + "row_min": 178 }, { + "height": 15, + "row_max": 193, + "column_min": 130, "id": 27, "width": 27, "class": "Compo", "column_max": 157, - "column_min": 130, - "height": 15, - "row_min": 178, - "row_max": 193 + "row_min": 178 }, { + "height": 15, + "row_max": 193, + "column_min": 162, "id": 28, "width": 50, "class": "Compo", "column_max": 212, - "column_min": 162, - "height": 15, - "row_min": 178, - "row_max": 193 + "row_min": 178 }, { + "height": 14, + "row_max": 193, + "column_min": 216, "id": 29, "width": 13, "class": "Compo", "column_max": 229, - "column_min": 216, - "height": 14, - "row_min": 179, - "row_max": 193 + "row_min": 179 }, { + "height": 19, + "row_max": 197, + "column_min": 233, "id": 30, "width": 51, "class": "Compo", "column_max": 284, - "column_min": 233, - "height": 19, - "row_min": 178, - "row_max": 197 + "row_min": 178 }, { + "height": 15, + "row_max": 193, + "column_min": 286, "id": 31, "width": 40, "class": "Compo", "column_max": 326, - "column_min": 286, - "height": 15, - "row_min": 178, - "row_max": 193 + "row_min": 178 }, { + "height": 12, + "row_max": 217, + "column_min": 93, "id": 32, "width": 16, "class": "Compo", "column_max": 109, - "column_min": 93, - "height": 12, - "row_min": 205, - "row_max": 217 + "row_min": 205 }, { + "height": 12, + "row_max": 217, + "column_min": 156, "id": 33, "width": 9, "class": "Compo", "column_max": 165, - "column_min": 156, - "height": 12, - "row_min": 205, - "row_max": 217 + "row_min": 205 }, { + "height": 10, + "row_max": 217, + "column_min": 112, "id": 34, "width": 27, "class": "Compo", "column_max": 139, - "column_min": 112, - "height": 10, - "row_min": 207, - "row_max": 217 + "row_min": 207 }, { + "height": 10, + "row_max": 217, + "column_min": 170, "id": 35, "width": 32, "class": "Compo", "column_max": 202, - "column_min": 170, - "height": 10, - "row_min": 207, - "row_max": 217 + "row_min": 207 }, { + "height": 66, + "row_max": 307, + "column_min": 21, "id": 36, "width": 67, "class": "Compo", "column_max": 88, - "column_min": 21, - "height": 66, - "row_min": 241, - "row_max": 307 + "row_min": 241 }, { + "height": 16, + "row_max": 270, + "column_min": 92, "id": 37, "width": 35, "class": "Compo", "column_max": 127, - "column_min": 92, - "height": 16, - "row_min": 254, - "row_max": 270 + "row_min": 254 }, { + "height": 16, + "row_max": 270, + "column_min": 153, "id": 38, "width": 35, "class": "Compo", "column_max": 188, - "column_min": 153, - "height": 16, - "row_min": 254, - "row_max": 270 + "row_min": 254 }, { + "height": 15, + "row_max": 269, + "column_min": 229, "id": 39, "width": 17, "class": "Compo", "column_max": 246, - "column_min": 229, - "height": 15, - "row_min": 254, - "row_max": 269 + "row_min": 254 }, { + "height": 16, + "row_max": 270, + "column_min": 247, "id": 40, "width": 19, "class": "Compo", "column_max": 266, - "column_min": 247, - "height": 16, - "row_min": 254, - "row_max": 270 + "row_min": 254 }, { + "height": 13, + "row_max": 269, + "column_min": 130, "id": 41, "width": 9, "class": "Compo", "column_max": 139, - "column_min": 130, - "height": 13, - "row_min": 256, - "row_max": 269 + "row_min": 256 }, { + "height": 12, + "row_max": 270, + "column_min": 139, "id": 42, "width": 10, "class": "Compo", "column_max": 149, - "column_min": 139, - "height": 12, - "row_min": 258, - "row_max": 270 + "row_min": 258 }, { + "height": 14, + "row_max": 270, + "column_min": 190, "id": 43, "width": 36, "class": "Compo", "column_max": 226, - "column_min": 190, - "height": 14, - "row_min": 256, - "row_max": 270 + "row_min": 256 }, { + "height": 15, + "row_max": 297, + "column_min": 93, "id": 44, "width": 16, "class": "Compo", "column_max": 109, - "column_min": 93, - "height": 15, - "row_min": 282, - "row_max": 297 + "row_min": 282 }, { + "height": 9, + "row_max": 293, + "column_min": 111, "id": 45, "width": 25, "class": "Compo", "column_max": 136, - "column_min": 111, - "height": 9, - "row_min": 284, - "row_max": 293 + "row_min": 284 }, { + "height": 14, + "row_max": 296, + "column_min": 156, "id": 46, "width": 10, "class": "Compo", "column_max": 166, - "column_min": 156, - "height": 14, - "row_min": 282, - "row_max": 296 + "row_min": 282 }, { + "height": 9, + "row_max": 293, + "column_min": 170, "id": 47, "width": 31, "class": "Compo", "column_max": 201, - "column_min": 170, - "height": 9, - "row_min": 284, - "row_max": 293 + "row_min": 284 }, { + "height": 69, + "row_max": 387, + "column_min": 20, "id": 48, "width": 69, "class": "Compo", "column_max": 89, - "column_min": 20, - "height": 69, - "row_min": 318, - "row_max": 387 + "row_min": 318 }, { + "height": 18, + "row_max": 349, + "column_min": 92, "id": 49, "width": 74, "class": "Compo", "column_max": 166, - "column_min": 92, - "height": 18, - "row_min": 331, - "row_max": 349 + "row_min": 331 }, { + "height": 13, + "row_max": 347, + "column_min": 169, "id": 50, "width": 40, "class": "Compo", "column_max": 209, - "column_min": 169, - "height": 13, - "row_min": 334, - "row_max": 347 + "row_min": 334 }, { + "height": 13, + "row_max": 347, + "column_min": 210, "id": 51, "width": 39, "class": "Compo", "column_max": 249, - "column_min": 210, - "height": 13, - "row_min": 334, - "row_max": 347 + "row_min": 334 }, { + "height": 13, + "row_max": 347, + "column_min": 252, "id": 52, "width": 27, "class": "Compo", "column_max": 279, - "column_min": 252, - "height": 13, - "row_min": 334, - "row_max": 347 + "row_min": 334 }, { + "height": 13, + "row_max": 347, + "column_min": 283, "id": 53, "width": 19, "class": "Compo", "column_max": 302, - "column_min": 283, - "height": 13, - "row_min": 334, - "row_max": 347 + "row_min": 334 }, { + "height": 13, + "row_max": 347, + "column_min": 306, "id": 54, "width": 40, "class": "Compo", "column_max": 346, - "column_min": 306, - "height": 13, - "row_min": 334, - "row_max": 347 + "row_min": 334 }, { + "height": 16, + "row_max": 347, + "column_min": 349, "id": 55, "width": 42, "class": "Compo", "column_max": 391, - "column_min": 349, - "height": 16, - "row_min": 331, - "row_max": 347 + "row_min": 331 }, { + "height": 12, + "row_max": 372, + "column_min": 93, "id": 56, "width": 15, "class": "Compo", "column_max": 108, - "column_min": 93, - "height": 12, - "row_min": 360, - "row_max": 372 + "row_min": 360 }, { + "height": 13, + "row_max": 372, + "column_min": 150, "id": 57, "width": 12, "class": "Compo", "column_max": 162, - "column_min": 150, - "height": 13, - "row_min": 359, - "row_max": 372 + "row_min": 359 }, { + "height": 9, + "row_max": 370, + "column_min": 110, "id": 58, "width": 22, "class": "Compo", "column_max": 132, - "column_min": 110, - "height": 9, - "row_min": 361, - "row_max": 370 + "row_min": 361 }, { + "height": 9, + "row_max": 370, + "column_min": 165, "id": 59, "width": 25, "class": "Compo", "column_max": 190, - "column_min": 165, - "height": 9, - "row_min": 361, - "row_max": 370 + "row_min": 361 }, { + "height": 68, + "row_max": 462, + "column_min": 20, "id": 60, - "width": 69, + "width": 68, "class": "Compo", - "column_max": 89, - "column_min": 20, - "height": 68, - "row_min": 394, - "row_max": 462 + "column_max": 88, + "row_min": 394 }, { + "height": 13, + "row_max": 423, + "column_min": 93, "id": 61, "width": 36, "class": "Compo", "column_max": 129, - "column_min": 93, - "height": 13, - "row_min": 410, - "row_max": 423 + "row_min": 410 }, { + "height": 13, + "row_max": 423, + "column_min": 218, "id": 62, "width": 31, "class": "Compo", "column_max": 249, - "column_min": 218, - "height": 13, - "row_min": 410, - "row_max": 423 + "row_min": 410 }, { + "height": 12, + "row_max": 423, + "column_min": 130, "id": 63, "width": 38, "class": "Compo", "column_max": 168, - "column_min": 130, - "height": 12, - "row_min": 411, - "row_max": 423 + "row_min": 411 }, { + "height": 12, + "row_max": 423, + "column_min": 173, "id": 64, "width": 41, "class": "Compo", "column_max": 214, - "column_min": 173, - "height": 12, - "row_min": 411, - "row_max": 423 + "row_min": 411 }, { + "height": 12, + "row_max": 423, + "column_min": 253, "id": 65, "width": 26, "class": "Compo", "column_max": 279, - "column_min": 253, - "height": 12, - "row_min": 411, - "row_max": 423 + "row_min": 411 }, { + "height": 13, + "row_max": 450, + "column_min": 93, "id": 66, "width": 14, "class": "Compo", "column_max": 107, - "column_min": 93, - "height": 13, - "row_min": 437, - "row_max": 450 + "row_min": 437 }, { + "height": 9, + "row_max": 447, + "column_min": 110, "id": 67, "width": 21, "class": "Compo", "column_max": 131, - "column_min": 110, - "height": 9, - "row_min": 438, - "row_max": 447 + "row_min": 438 }, { + "height": 12, + "row_max": 449, + "column_min": 150, "id": 68, "width": 11, "class": "Compo", "column_max": 161, - "column_min": 150, - "height": 12, - "row_min": 437, - "row_max": 449 + "row_min": 437 }, { + "height": 9, + "row_max": 447, + "column_min": 164, "id": 69, "width": 27, "class": "Compo", "column_max": 191, - "column_min": 164, - "height": 9, - "row_min": 438, - "row_max": 447 + "row_min": 438 }, { + "height": 69, + "row_max": 540, + "column_min": 20, "id": 70, "width": 68, "class": "Compo", "column_max": 88, - "column_min": 20, - "height": 69, - "row_min": 471, - "row_max": 540 + "row_min": 471 }, { + "height": 13, + "row_max": 500, + "column_min": 92, "id": 71, "width": 27, "class": "Compo", "column_max": 119, - "column_min": 92, - "height": 13, - "row_min": 487, - "row_max": 500 + "row_min": 487 }, { + "height": 16, + "row_max": 503, + "column_min": 124, "id": 72, "width": 45, "class": "Compo", "column_max": 169, - "column_min": 124, - "height": 16, - "row_min": 487, - "row_max": 503 + "row_min": 487 }, { + "height": 13, + "row_max": 500, + "column_min": 173, "id": 73, "width": 36, "class": "Compo", "column_max": 209, - "column_min": 173, - "height": 13, - "row_min": 487, - "row_max": 500 + "row_min": 487 }, { + "height": 13, + "row_max": 500, + "column_min": 212, "id": 74, "width": 57, "class": "Compo", "column_max": 269, - "column_min": 212, - "height": 13, - "row_min": 487, - "row_max": 500 + "row_min": 487 }, { + "height": 13, + "row_max": 527, + "column_min": 93, "id": 75, "width": 15, "class": "Compo", "column_max": 108, - "column_min": 93, - "height": 13, - "row_min": 514, - "row_max": 527 + "row_min": 514 }, { + "height": 13, + "row_max": 527, + "column_min": 147, "id": 76, "width": 11, "class": "Compo", "column_max": 158, - "column_min": 147, - "height": 13, - "row_min": 514, - "row_max": 527 + "row_min": 514 }, { + "height": 11, + "row_max": 525, + "column_min": 162, "id": 77, "width": 32, "class": "Compo", "column_max": 194, - "column_min": 162, - "height": 11, - "row_min": 514, - "row_max": 525 + "row_min": 514 }, { + "height": 11, + "row_max": 527, + "column_min": 111, "id": 78, "width": 18, "class": "Compo", "column_max": 129, - "column_min": 111, - "height": 11, - "row_min": 516, - "row_max": 527 + "row_min": 516 }, { + "height": 67, + "row_max": 616, + "column_min": 20, "id": 79, "width": 68, "class": "Compo", "column_max": 88, - "column_min": 20, - "height": 67, - "row_min": 549, - "row_max": 616 + "row_min": 549 }, { + "height": 14, + "row_max": 577, + "column_min": 93, "id": 80, "width": 57, "class": "Compo", "column_max": 150, - "column_min": 93, - "height": 14, - "row_min": 563, - "row_max": 577 + "row_min": 563 }, { + "height": 14, + "row_max": 577, + "column_min": 153, "id": 81, "width": 35, "class": "Compo", "column_max": 188, - "column_min": 153, - "height": 14, - "row_min": 563, - "row_max": 577 + "row_min": 563 }, { + "height": 13, + "row_max": 577, + "column_min": 190, "id": 82, "width": 28, "class": "Compo", "column_max": 218, - "column_min": 190, - "height": 13, - "row_min": 564, - "row_max": 577 + "row_min": 564 }, { + "height": 14, + "row_max": 577, + "column_min": 222, "id": 83, "width": 50, "class": "Compo", "column_max": 272, - "column_min": 222, - "height": 14, - "row_min": 563, - "row_max": 577 + "row_min": 563 }, { + "height": 13, + "row_max": 577, + "column_min": 277, "id": 84, "width": 39, "class": "Compo", "column_max": 316, - "column_min": 277, - "height": 13, - "row_min": 564, - "row_max": 577 + "row_min": 564 }, { + "height": 12, + "row_max": 603, + "column_min": 93, "id": 85, "width": 14, "class": "Compo", "column_max": 107, - "column_min": 93, - "height": 12, - "row_min": 591, - "row_max": 603 + "row_min": 591 }, { + "height": 10, + "row_max": 603, + "column_min": 110, "id": 86, "width": 19, "class": "Compo", "column_max": 129, - "column_min": 110, - "height": 10, - "row_min": 593, - "row_max": 603 + "row_min": 593 }, { + "height": 12, + "row_max": 603, + "column_min": 147, "id": 87, "width": 11, "class": "Compo", "column_max": 158, - "column_min": 147, - "height": 12, - "row_min": 591, - "row_max": 603 + "row_min": 591 }, { + "height": 12, + "row_max": 603, + "column_min": 162, "id": 88, "width": 20, "class": "Compo", "column_max": 182, - "column_min": 162, - "height": 12, - "row_min": 591, - "row_max": 603 + "row_min": 591 }, { + "height": 67, + "row_max": 693, + "column_min": 20, "id": 89, "width": 68, "class": "Compo", "column_max": 88, - "column_min": 20, - "height": 67, - "row_min": 626, - "row_max": 693 + "row_min": 626 }, { + "height": 16, + "row_max": 657, + "column_min": 92, "id": 90, "width": 36, "class": "Compo", "column_max": 128, - "column_min": 92, - "height": 16, - "row_min": 641, - "row_max": 657 + "row_min": 641 }, { + "height": 17, + "row_max": 658, + "column_min": 130, "id": 91, "width": 34, "class": "Compo", "column_max": 164, - "column_min": 130, - "height": 17, - "row_min": 641, - "row_max": 658 + "row_min": 641 }, { + "height": 14, + "row_max": 655, + "column_min": 169, "id": 92, "width": 39, "class": "Compo", "column_max": 208, - "column_min": 169, - "height": 14, - "row_min": 641, - "row_max": 655 + "row_min": 641 }, { + "height": 14, + "row_max": 655, + "column_min": 210, "id": 93, "width": 39, "class": "Compo", "column_max": 249, - "column_min": 210, - "height": 14, - "row_min": 641, - "row_max": 655 + "row_min": 641 }, { + "height": 13, + "row_max": 654, + "column_min": 250, "id": 94, "width": 11, "class": "Compo", "column_max": 261, - "column_min": 250, - "height": 13, - "row_min": 641, - "row_max": 654 + "row_min": 641 }, { + "height": 11, + "row_max": 655, + "column_min": 261, "id": 95, "width": 18, "class": "Compo", "column_max": 279, - "column_min": 261, - "height": 11, - "row_min": 644, - "row_max": 655 + "row_min": 644 }, { + "height": 14, + "row_max": 656, + "column_min": 283, "id": 96, "width": 18, "class": "Compo", "column_max": 301, - "column_min": 283, - "height": 14, - "row_min": 642, - "row_max": 656 + "row_min": 642 }, { + "height": 16, + "row_max": 657, + "column_min": 306, "id": 97, "width": 40, "class": "Compo", "column_max": 346, - "column_min": 306, - "height": 16, - "row_min": 641, - "row_max": 657 + "row_min": 641 }, { + "height": 11, + "row_max": 680, + "column_min": 93, "id": 98, "width": 15, "class": "Compo", "column_max": 108, - "column_min": 93, - "height": 11, - "row_min": 669, - "row_max": 680 + "row_min": 669 }, { + "height": 12, + "row_max": 680, + "column_min": 150, "id": 99, "width": 11, "class": "Compo", "column_max": 161, - "column_min": 150, - "height": 12, - "row_min": 668, - "row_max": 680 + "row_min": 668 }, { + "height": 10, + "row_max": 680, + "column_min": 164, "id": 100, "width": 20, "class": "Compo", "column_max": 184, - "column_min": 164, - "height": 10, - "row_min": 670, - "row_max": 680 + "row_min": 670 }, { + "height": 10, + "row_max": 680, + "column_min": 120, "id": 101, "width": 11, "class": "Compo", "column_max": 131, - "column_min": 120, - "height": 10, - "row_min": 670, - "row_max": 680 + "row_min": 670 }, { + "height": 16, + "row_max": 720, + "column_min": 21, "id": 102, "width": 66, "class": "Compo", "column_max": 87, - "column_min": 21, - "height": 16, - "row_min": 704, - "row_max": 720 + "row_min": 704 }, { + "height": 23, + "row_max": 786, + "column_min": 88, "id": 103, "width": 20, "class": "Compo", "column_max": 108, - "column_min": 88, - "height": 23, - "row_min": 763, - "row_max": 786 + "row_min": 763 }, { + "height": 21, + "row_max": 784, + "column_min": 214, "id": 104, "width": 21, "class": "Compo", "column_max": 235, - "column_min": 214, - "height": 21, - "row_min": 763, - "row_max": 784 + "row_min": 763 }, { + "height": 20, + "row_max": 783, + "column_min": 341, "id": 105, "width": 20, "class": "Compo", "column_max": 361, - "column_min": 341, - "height": 20, - "row_min": 763, - "row_max": 783 + "row_min": 763 } + ], + "img_shape": [ + 800, + 450, + 3 ] } \ No newline at end of file diff --git a/data/output/merge/497.jpg b/data/output/merge/497.jpg index 30c6a29..346df56 100644 Binary files a/data/output/merge/497.jpg and b/data/output/merge/497.jpg differ diff --git a/data/output/merge/497.json b/data/output/merge/497.json index 2b6bde0..199b3d9 100644 --- a/data/output/merge/497.json +++ b/data/output/merge/497.json @@ -1,598 +1,598 @@ { - "img_shape": [ - 800, - 450, - 3 - ], "compos": [ { + "height": 39, + "class": "Compo", + "width": 369, "id": 0, "position": { - "column_min": 10, - "row_min": 34, "row_max": 73, - "column_max": 379 - }, - "width": 369, - "class": "Compo", - "height": 39 + "column_max": 379, + "column_min": 10, + "row_min": 34 + } }, { + "height": 62, + "class": "Compo", + "width": 67, "id": 1, "position": { - "column_min": 20, - "row_min": 91, "row_max": 153, - "column_max": 88 - }, - "width": 68, - "class": "Compo", - "height": 62 + "column_max": 88, + "column_min": 21, + "row_min": 91 + } }, { + "height": 12, + "class": "Compo", + "width": 9, "id": 2, "position": { - "column_min": 156, - "row_min": 128, "row_max": 140, - "column_max": 165 - }, - "width": 9, - "class": "Compo", - "height": 12 + "column_max": 165, + "column_min": 156, + "row_min": 128 + } }, { + "height": 66, + "class": "Compo", + "width": 67, "id": 3, "position": { - "column_min": 21, - "row_min": 164, "row_max": 230, - "column_max": 88 - }, - "width": 67, - "class": "Compo", - "height": 66 + "column_max": 88, + "column_min": 21, + "row_min": 164 + } }, { + "height": 12, + "class": "Compo", + "width": 9, "id": 4, "position": { - "column_min": 156, - "row_min": 205, "row_max": 217, - "column_max": 165 - }, - "width": 9, - "class": "Compo", - "height": 12 + "column_max": 165, + "column_min": 156, + "row_min": 205 + } }, { + "height": 66, + "class": "Compo", + "width": 67, "id": 5, "position": { - "column_min": 21, - "row_min": 241, "row_max": 307, - "column_max": 88 - }, - "width": 67, - "class": "Compo", - "height": 66 + "column_max": 88, + "column_min": 21, + "row_min": 241 + } }, { + "height": 15, + "class": "Compo", + "width": 16, "id": 6, "position": { - "column_min": 93, - "row_min": 282, "row_max": 297, - "column_max": 109 - }, - "width": 16, - "class": "Compo", - "height": 15 + "column_max": 109, + "column_min": 93, + "row_min": 282 + } }, { + "height": 14, + "class": "Compo", + "width": 10, "id": 7, "position": { - "column_min": 156, - "row_min": 282, "row_max": 296, - "column_max": 166 - }, - "width": 10, - "class": "Compo", - "height": 14 + "column_max": 166, + "column_min": 156, + "row_min": 282 + } }, { + "height": 69, + "class": "Compo", + "width": 69, "id": 8, "position": { - "column_min": 20, - "row_min": 318, "row_max": 387, - "column_max": 89 - }, - "width": 69, - "class": "Compo", - "height": 69 + "column_max": 89, + "column_min": 20, + "row_min": 318 + } }, { + "height": 12, + "class": "Compo", + "width": 15, "id": 9, "position": { - "column_min": 93, - "row_min": 360, "row_max": 372, - "column_max": 108 - }, - "width": 15, - "class": "Compo", - "height": 12 + "column_max": 108, + "column_min": 93, + "row_min": 360 + } }, { + "height": 13, + "class": "Compo", + "width": 12, "id": 10, "position": { - "column_min": 150, - "row_min": 359, "row_max": 372, - "column_max": 162 - }, - "width": 12, - "class": "Compo", - "height": 13 + "column_max": 162, + "column_min": 150, + "row_min": 359 + } }, { + "height": 68, + "class": "Compo", + "width": 68, "id": 11, "position": { - "column_min": 20, - "row_min": 394, "row_max": 462, - "column_max": 89 - }, - "width": 69, - "class": "Compo", - "height": 68 + "column_max": 88, + "column_min": 20, + "row_min": 394 + } }, { + "height": 12, + "class": "Compo", + "width": 11, "id": 12, "position": { - "column_min": 150, - "row_min": 437, "row_max": 449, - "column_max": 161 - }, - "width": 11, - "class": "Compo", - "height": 12 + "column_max": 161, + "column_min": 150, + "row_min": 437 + } }, { + "height": 69, + "class": "Compo", + "width": 68, "id": 13, "position": { - "column_min": 20, - "row_min": 471, "row_max": 540, - "column_max": 88 - }, - "width": 68, - "class": "Compo", - "height": 69 + "column_max": 88, + "column_min": 20, + "row_min": 471 + } }, { + "height": 13, + "class": "Compo", + "width": 15, "id": 14, "position": { - "column_min": 93, - "row_min": 514, "row_max": 527, - "column_max": 108 - }, - "width": 15, - "class": "Compo", - "height": 13 + "column_max": 108, + "column_min": 93, + "row_min": 514 + } }, { + "height": 13, + "class": "Compo", + "width": 11, "id": 15, "position": { - "column_min": 147, - "row_min": 514, "row_max": 527, - "column_max": 158 - }, - "width": 11, - "class": "Compo", - "height": 13 + "column_max": 158, + "column_min": 147, + "row_min": 514 + } }, { + "height": 67, + "class": "Compo", + "width": 68, "id": 16, "position": { - "column_min": 20, - "row_min": 549, "row_max": 616, - "column_max": 88 - }, - "width": 68, - "class": "Compo", - "height": 67 + "column_max": 88, + "column_min": 20, + "row_min": 549 + } }, { + "height": 12, + "class": "Compo", + "width": 11, "id": 17, "position": { - "column_min": 147, - "row_min": 591, "row_max": 603, - "column_max": 158 - }, - "width": 11, - "class": "Compo", - "height": 12 + "column_max": 158, + "column_min": 147, + "row_min": 591 + } }, { + "height": 67, + "class": "Compo", + "width": 68, "id": 18, "position": { - "column_min": 20, - "row_min": 626, "row_max": 693, - "column_max": 88 - }, - "width": 68, - "class": "Compo", - "height": 67 + "column_max": 88, + "column_min": 20, + "row_min": 626 + } }, { + "height": 11, + "class": "Compo", + "width": 15, "id": 19, "position": { - "column_min": 93, - "row_min": 669, "row_max": 680, - "column_max": 108 - }, - "width": 15, - "class": "Compo", - "height": 11 + "column_max": 108, + "column_min": 93, + "row_min": 669 + } }, { + "height": 12, + "class": "Compo", + "width": 11, "id": 20, "position": { - "column_min": 150, - "row_min": 668, "row_max": 680, - "column_max": 161 - }, - "width": 11, - "class": "Compo", - "height": 12 + "column_max": 161, + "column_min": 150, + "row_min": 668 + } }, { + "height": 16, + "class": "Compo", + "width": 66, "id": 21, "position": { - "column_min": 21, - "row_min": 704, "row_max": 720, - "column_max": 87 - }, - "width": 66, - "class": "Compo", - "height": 16 + "column_max": 87, + "column_min": 21, + "row_min": 704 + } }, { + "height": 18, + "text_content": "X X Cancel", "id": 22, - "width": 51, "class": "Text", + "width": 94, "position": { - "column_min": 386, - "row_min": 44, "row_max": 62, - "column_max": 437 - }, - "text_content": "Cancel", - "height": 18 + "column_max": 437, + "column_min": 343, + "row_min": 44 + } }, { + "height": 15, + "text_content": "Stuff You Should Know", "id": 23, - "width": 161, "class": "Text", + "width": 161, "position": { - "column_min": 94, - "row_min": 99, "row_max": 114, - "column_max": 255 - }, - "text_content": "Stuff You Should Know", - "height": 15 + "column_max": 255, + "column_min": 94, + "row_min": 99 + } }, { + "height": 13, + "text_content": "+ 26.7k", "id": 24, - "width": 32, "class": "Text", + "width": 32, "position": { - "column_min": 104, - "row_min": 127, "row_max": 140, - "column_max": 136 - }, - "text_content": "+ 26.7k", - "height": 13 + "column_max": 136, + "column_min": 104, + "row_min": 127 + } }, { + "height": 12, + "text_content": "665.Ok", "id": 25, - "width": 30, "class": "Text", + "width": 30, "position": { - "column_min": 171, - "row_min": 127, "row_max": 139, - "column_max": 201 - }, - "text_content": "665.Ok", - "height": 12 + "column_max": 201, + "column_min": 171, + "row_min": 127 + } }, { + "height": 19, + "text_content": "Stuff You Missed in History Class", "id": 26, - "width": 229, "class": "Text", + "width": 229, "position": { - "column_min": 94, - "row_min": 176, "row_max": 195, - "column_max": 323 - }, - "text_content": "Stuff You Missed in History Class", - "height": 19 + "column_max": 323, + "column_min": 94, + "row_min": 176 + } }, { + "height": 13, + "text_content": "& + 13.7k", "id": 27, - "width": 42, "class": "Text", + "width": 42, "position": { - "column_min": 94, - "row_min": 204, "row_max": 217, - "column_max": 136 - }, - "text_content": "& + 13.7k", - "height": 13 + "column_max": 136, + "column_min": 94, + "row_min": 204 + } }, { + "height": 12, + "text_content": "274.Ok", "id": 28, - "width": 30, "class": "Text", + "width": 30, "position": { - "column_min": 171, - "row_min": 204, "row_max": 216, - "column_max": 201 - }, - "text_content": "274.Ok", - "height": 12 + "column_max": 201, + "column_min": 171, + "row_min": 204 + } }, { + "height": 15, + "text_content": "Stuff To Blow Your Mind", "id": 29, - "width": 170, "class": "Text", + "width": 170, "position": { - "column_min": 94, - "row_min": 254, "row_max": 269, - "column_max": 264 - }, - "text_content": "Stuff To Blow Your Mind", - "height": 15 + "column_max": 264, + "column_min": 94, + "row_min": 254 + } }, { + "height": 13, + "text_content": "+ 12.7k", "id": 30, - "width": 31, "class": "Text", + "width": 31, "position": { - "column_min": 105, - "row_min": 281, "row_max": 294, - "column_max": 136 - }, - "text_content": "+ 12.7k", - "height": 13 + "column_max": 136, + "column_min": 105, + "row_min": 281 + } }, { + "height": 12, + "text_content": "190.4k", "id": 31, - "width": 29, "class": "Text", + "width": 29, "position": { - "column_min": 172, - "row_min": 282, "row_max": 294, - "column_max": 201 - }, - "text_content": "190.4k", - "height": 12 + "column_max": 201, + "column_min": 172, + "row_min": 282 + } }, { + "height": 19, + "text_content": "Stuff They Don't Want You To Know Audio", "id": 32, - "width": 296, "class": "Text", + "width": 296, "position": { - "column_min": 94, - "row_min": 330, "row_max": 349, - "column_max": 390 - }, - "text_content": "Stuff They Don't Want You To Know Audio", - "height": 19 + "column_max": 390, + "column_min": 94, + "row_min": 330 + } }, { + "height": 12, + "text_content": "+ 3.4k", "id": 33, - "width": 26, "class": "Text", + "width": 26, "position": { - "column_min": 104, - "row_min": 359, "row_max": 371, - "column_max": 130 - }, - "text_content": "+ 3.4k", - "height": 12 + "column_max": 130, + "column_min": 104, + "row_min": 359 + } }, { + "height": 12, + "text_content": "72.2k", "id": 34, - "width": 25, "class": "Text", + "width": 25, "position": { - "column_min": 165, - "row_min": 359, "row_max": 371, - "column_max": 190 - }, - "text_content": "72.2k", - "height": 12 + "column_max": 190, + "column_min": 165, + "row_min": 359 + } }, { + "height": 16, + "text_content": "Stuff Mom Never Told You", "id": 35, - "width": 185, "class": "Text", + "width": 185, "position": { - "column_min": 94, - "row_min": 408, "row_max": 424, - "column_max": 279 - }, - "text_content": "Stuff Mom Never Told You", - "height": 16 + "column_max": 279, + "column_min": 94, + "row_min": 408 + } }, { + "height": 12, + "text_content": "2+ 2.Ok", "id": 36, - "width": 37, "class": "Text", + "width": 37, "position": { - "column_min": 93, - "row_min": 436, "row_max": 448, - "column_max": 130 - }, - "text_content": "2+ 2.Ok", - "height": 12 + "column_max": 130, + "column_min": 93, + "row_min": 436 + } }, { + "height": 12, + "text_content": "48.5k", "id": 37, - "width": 25, "class": "Text", + "width": 25, "position": { - "column_min": 165, - "row_min": 436, "row_max": 448, - "column_max": 190 - }, - "text_content": "48.5k", - "height": 12 + "column_max": 190, + "column_min": 165, + "row_min": 436 + } }, { + "height": 17, + "text_content": "The Purple Stuff Podcast", "id": 38, - "width": 175, "class": "Text", + "width": 175, "position": { - "column_min": 92, - "row_min": 485, "row_max": 502, - "column_max": 267 - }, - "text_content": "The Purple Stuff Podcast", - "height": 17 + "column_max": 267, + "column_min": 92, + "row_min": 485 + } }, { + "height": 13, + "text_content": "+ 949", "id": 39, - "width": 23, "class": "Text", + "width": 23, "position": { - "column_min": 105, - "row_min": 513, "row_max": 526, - "column_max": 128 - }, - "text_content": "+ 949", - "height": 13 + "column_max": 128, + "column_min": 105, + "row_min": 513 + } }, { + "height": 12, + "text_content": "625.3k", "id": 40, - "width": 29, "class": "Text", + "width": 29, "position": { - "column_min": 163, - "row_min": 513, "row_max": 525, - "column_max": 192 - }, - "text_content": "625.3k", - "height": 12 + "column_max": 192, + "column_min": 163, + "row_min": 513 + } }, { + "height": 14, + "text_content": "Catholic Stuff You Should Know", "id": 41, - "width": 222, "class": "Text", + "width": 222, "position": { - "column_min": 94, - "row_min": 563, "row_max": 577, - "column_max": 316 - }, - "text_content": "Catholic Stuff You Should Know", - "height": 14 + "column_max": 316, + "column_min": 94, + "row_min": 563 + } }, { + "height": 12, + "text_content": "2+ 683", "id": 42, - "width": 34, "class": "Text", + "width": 34, "position": { - "column_min": 94, - "row_min": 590, "row_max": 602, - "column_max": 128 - }, - "text_content": "2+ 683", - "height": 12 + "column_max": 128, + "column_min": 94, + "row_min": 590 + } }, { + "height": 12, + "text_content": "8.8k", "id": 43, - "width": 18, "class": "Text", + "width": 18, "position": { - "column_min": 163, - "row_min": 590, "row_max": 602, - "column_max": 181 - }, - "text_content": "8.8k", - "height": 12 + "column_max": 181, + "column_min": 163, + "row_min": 590 + } }, { + "height": 18, + "text_content": "Stuff They Don't Want You To Know", "id": 44, - "width": 251, "class": "Text", + "width": 251, "position": { - "column_min": 94, - "row_min": 639, "row_max": 657, - "column_max": 345 - }, - "text_content": "Stuff They Don't Want You To Know", - "height": 18 + "column_max": 345, + "column_min": 94, + "row_min": 639 + } }, { + "height": 12, + "text_content": "+ 1.1k", "id": 45, - "width": 26, "class": "Text", + "width": 26, "position": { - "column_min": 104, - "row_min": 667, "row_max": 679, - "column_max": 130 - }, - "text_content": "+ 1.1k", - "height": 12 + "column_max": 130, + "column_min": 104, + "row_min": 667 + } }, { + "height": 12, + "text_content": "5.4k", "id": 46, - "width": 18, "class": "Text", + "width": 18, "position": { - "column_min": 166, - "row_min": 667, "row_max": 679, - "column_max": 184 - }, - "text_content": "5.4k", - "height": 12 + "column_max": 184, + "column_min": 166, + "row_min": 667 + } } + ], + "img_shape": [ + 800, + 450, + 3 ] } \ No newline at end of file diff --git a/data/output/ocr/497.json b/data/output/ocr/497.json index 557b0e1..6079436 100644 --- a/data/output/ocr/497.json +++ b/data/output/ocr/497.json @@ -1,489 +1,489 @@ { - "img_shape": [ - 1920, - 1080, - 3 - ], "texts": [ { + "height": 12, + "row_max": 23, + "content": "FAK", "id": 0, "width": 31, - "content": "FAK", "column_max": 373, - "column_min": 342, - "height": 12, "row_min": 11, - "row_max": 23 + "column_min": 342 }, { + "height": 41, + "row_max": 51, + "content": "fo", "id": 1, "width": 96, - "content": "fo", "column_max": 188, - "column_min": 92, - "height": 41, "row_min": 10, - "row_max": 51 + "column_min": 92 }, { + "height": 31, + "row_max": 47, + "content": "3:17", "id": 2, "width": 68, - "content": "3:17", "column_max": 1055, - "column_min": 987, - "height": 31, "row_min": 16, - "row_max": 47 + "column_min": 987 }, { + "height": 33, + "row_max": 143, + "content": "stuff", "id": 3, "width": 77, - "content": "stuff", "column_max": 249, - "column_min": 172, - "height": 33, "row_min": 110, - "row_max": 143 + "column_min": 172 }, { + "height": 45, + "row_max": 151, + "content": "X X Cancel", "id": 4, - "width": 121, - "content": "Cancel", + "width": 225, "column_max": 1049, - "column_min": 928, - "height": 45, "row_min": 106, - "row_max": 151 + "column_min": 824 }, { + "height": 36, + "row_max": 275, + "content": "Stuff You Should Know", "id": 5, "width": 387, - "content": "Stuff You Should Know", "column_max": 613, - "column_min": 226, - "height": 36, "row_min": 239, - "row_max": 275 + "column_min": 226 }, { + "height": 18, + "row_max": 272, + "content": "STUFF", "id": 6, "width": 54, - "content": "STUFF", "column_max": 119, - "column_min": 65, - "height": 18, "row_min": 254, - "row_max": 272 + "column_min": 65 }, { + "height": 17, + "row_max": 291, + "content": "YOU SHOULD", "id": 7, "width": 127, - "content": "YOU SHOULD", "column_max": 193, - "column_min": 66, - "height": 17, "row_min": 274, - "row_max": 291 + "column_min": 66 }, { + "height": 18, + "row_max": 311, + "content": "KNOW", "id": 8, "width": 65, - "content": "KNOW", "column_max": 132, - "column_min": 67, - "height": 18, "row_min": 293, - "row_max": 311 + "column_min": 67 }, { + "height": 30, + "row_max": 336, + "content": "+ 26.7k", "id": 9, "width": 77, - "content": "+ 26.7k", "column_max": 327, - "column_min": 250, - "height": 30, "row_min": 306, - "row_max": 336 + "column_min": 250 }, { + "height": 29, + "row_max": 335, + "content": "665.Ok", "id": 10, "width": 71, - "content": "665.Ok", "column_max": 483, - "column_min": 412, - "height": 29, "row_min": 306, - "row_max": 335 + "column_min": 412 }, { + "height": 16, + "row_max": 343, + "content": "PODCAST", "id": 11, "width": 80, - "content": "PODCAST", "column_max": 146, - "column_min": 66, - "height": 16, "row_min": 327, - "row_max": 343 + "column_min": 66 }, { + "height": 47, + "row_max": 470, + "content": "Stuff You Missed in History Class", "id": 12, "width": 550, - "content": "Stuff You Missed in History Class", "column_max": 776, - "column_min": 226, - "height": 47, "row_min": 423, - "row_max": 470 + "column_min": 226 }, { + "height": 18, + "row_max": 482, + "content": "STUFF", "id": 13, "width": 32, - "content": "STUFF", "column_max": 186, - "column_min": 154, - "height": 18, "row_min": 464, - "row_max": 482 + "column_min": 154 }, { + "height": 31, + "row_max": 522, + "content": "& + 13.7k", "id": 14, "width": 101, - "content": "& + 13.7k", "column_max": 328, - "column_min": 227, - "height": 31, "row_min": 491, - "row_max": 522 + "column_min": 227 }, { + "height": 29, + "row_max": 520, + "content": "274.Ok", "id": 15, "width": 71, - "content": "274.Ok", "column_max": 483, - "column_min": 412, - "height": 29, "row_min": 491, - "row_max": 520 + "column_min": 412 }, { + "height": 12, + "row_max": 520, + "content": "YOU MISSED IN", "id": 16, "width": 79, - "content": "YOU MISSED IN", "column_max": 141, - "column_min": 62, - "height": 12, "row_min": 508, - "row_max": 520 + "column_min": 62 }, { + "height": 20, + "row_max": 539, + "content": "HISTORY CLASS", "id": 17, "width": 143, - "content": "HISTORY CLASS", "column_max": 204, - "column_min": 61, - "height": 20, "row_min": 519, - "row_max": 539 + "column_min": 61 }, { + "height": 43, + "row_max": 654, + "content": "BLOW stuff YOUR to", "id": 18, "width": 79, - "content": "BLOW stuff YOUR to", "column_max": 198, - "column_min": 119, - "height": 43, "row_min": 611, - "row_max": 654 + "column_min": 119 }, { + "height": 35, + "row_max": 646, + "content": "Stuff To Blow Your Mind", "id": 19, "width": 408, - "content": "Stuff To Blow Your Mind", "column_max": 634, - "column_min": 226, - "height": 35, "row_min": 611, - "row_max": 646 + "column_min": 226 }, { + "height": 32, + "row_max": 686, + "content": "MIND", "id": 20, "width": 98, - "content": "MIND", "column_max": 196, - "column_min": 98, - "height": 32, "row_min": 654, - "row_max": 686 + "column_min": 98 }, { + "height": 30, + "row_max": 706, + "content": "+ 12.7k", "id": 21, "width": 75, - "content": "+ 12.7k", "column_max": 327, - "column_min": 252, - "height": 30, "row_min": 676, - "row_max": 706 + "column_min": 252 }, { + "height": 29, + "row_max": 707, + "content": "190.4k", "id": 22, "width": 70, - "content": "190.4k", "column_max": 483, - "column_min": 413, - "height": 29, "row_min": 678, - "row_max": 707 + "column_min": 413 }, { + "height": 68, + "row_max": 869, + "content": "AUDIO STUFF DON THEY WANT KNOW YOU TO", "id": 23, "width": 94, - "content": "AUDIO STUFF DON THEY WANT KNOW YOU TO", "column_max": 187, - "column_min": 93, - "height": 68, "row_min": 801, - "row_max": 869 + "column_min": 93 }, { + "height": 44, + "row_max": 838, + "content": "Stuff They Don't Want You To Know Audio", "id": 24, "width": 711, - "content": "Stuff They Don't Want You To Know Audio", "column_max": 937, - "column_min": 226, - "height": 44, "row_min": 794, - "row_max": 838 + "column_min": 226 }, { + "height": 29, + "row_max": 891, + "content": "+ 3.4k", "id": 25, "width": 63, - "content": "+ 3.4k", "column_max": 313, - "column_min": 250, - "height": 29, "row_min": 862, - "row_max": 891 + "column_min": 250 }, { + "height": 29, + "row_max": 892, + "content": "72.2k", "id": 26, "width": 58, - "content": "72.2k", "column_max": 456, - "column_min": 398, - "height": 29, "row_min": 863, - "row_max": 892 + "column_min": 398 }, { + "height": 13, + "row_max": 1003, + "content": "stuff mom", "id": 27, "width": 75, - "content": "stuff mom", "column_max": 157, - "column_min": 82, - "height": 13, "row_min": 990, - "row_max": 1003 + "column_min": 82 }, { + "height": 55, + "row_max": 1056, + "content": "never told you", "id": 28, "width": 133, - "content": "never told you", "column_max": 198, - "column_min": 65, - "height": 55, "row_min": 1001, - "row_max": 1056 + "column_min": 65 }, { + "height": 38, + "row_max": 1019, + "content": "Stuff Mom Never Told You", "id": 29, "width": 445, - "content": "Stuff Mom Never Told You", "column_max": 671, - "column_min": 226, - "height": 38, "row_min": 981, - "row_max": 1019 + "column_min": 226 }, { + "height": 18, + "row_max": 1072, + "content": "audio", "id": 30, "width": 44, - "content": "audio", "column_max": 191, - "column_min": 147, - "height": 18, "row_min": 1054, - "row_max": 1072 + "column_min": 147 }, { + "height": 29, + "row_max": 1076, + "content": "2+ 2.Ok", "id": 31, "width": 88, - "content": "2+ 2.Ok", "column_max": 313, - "column_min": 225, - "height": 29, "row_min": 1047, - "row_max": 1076 + "column_min": 225 }, { + "height": 28, + "row_max": 1076, + "content": "48.5k", "id": 32, "width": 58, - "content": "48.5k", "column_max": 456, - "column_min": 398, - "height": 28, "row_min": 1048, - "row_max": 1076 + "column_min": 398 }, { + "height": 44, + "row_max": 1182, + "content": "PURPLE PODCAST STUFF", "id": 33, "width": 137, - "content": "PURPLE PODCAST STUFF", "column_max": 204, - "column_min": 67, - "height": 44, "row_min": 1138, - "row_max": 1182 + "column_min": 67 }, { + "height": 42, + "row_max": 1206, + "content": "The Purple Stuff Podcast", "id": 34, "width": 418, - "content": "The Purple Stuff Podcast", "column_max": 641, - "column_min": 223, - "height": 42, "row_min": 1164, - "row_max": 1206 + "column_min": 223 }, { + "height": 31, + "row_max": 1263, + "content": "+ 949", "id": 35, "width": 56, - "content": "+ 949", "column_max": 308, - "column_min": 252, - "height": 31, "row_min": 1232, - "row_max": 1263 + "column_min": 252 }, { + "height": 28, + "row_max": 1261, + "content": "625.3k", "id": 36, "width": 70, - "content": "625.3k", "column_max": 463, - "column_min": 393, - "height": 28, "row_min": 1233, - "row_max": 1261 + "column_min": 393 }, { + "height": 154, + "row_max": 1470, + "content": "CATHO . YOU SHOULO KNOW STUFF .", "id": 37, "width": 159, - "content": "CATHO STUFF . KNOW YOU SHOULO", "column_max": 206, - "column_min": 47, - "height": 154, "row_min": 1316, - "row_max": 1470 + "column_min": 47 }, { + "height": 33, + "row_max": 1385, + "content": "Catholic Stuff You Should Know", "id": 38, "width": 533, - "content": "Catholic Stuff You Should Know", "column_max": 759, - "column_min": 226, - "height": 33, "row_min": 1352, - "row_max": 1385 + "column_min": 226 }, { + "height": 28, + "row_max": 1446, + "content": "2+ 683", "id": 39, "width": 81, - "content": "2+ 683", "column_max": 308, - "column_min": 227, - "height": 28, "row_min": 1418, - "row_max": 1446 + "column_min": 227 }, { + "height": 28, + "row_max": 1446, + "content": "8.8k", "id": 40, "width": 43, - "content": "8.8k", "column_max": 436, - "column_min": 393, - "height": 28, "row_min": 1418, - "row_max": 1446 + "column_min": 393 }, { + "height": 14, + "row_max": 1550, + "content": "STUFE", "id": 41, "width": 42, - "content": "STUFE", "column_max": 152, - "column_min": 110, - "height": 14, "row_min": 1536, - "row_max": 1550 + "column_min": 110 }, { + "height": 45, + "row_max": 1593, + "content": "THEY DONT WANT YOU TO KNOW", "id": 42, "width": 75, - "content": "THEY DONT WANT YOU TO KNOW", "column_max": 166, - "column_min": 91, - "height": 45, "row_min": 1548, - "row_max": 1593 + "column_min": 91 }, { + "height": 45, + "row_max": 1579, + "content": "Stuff They Don't Want You To Know", "id": 43, "width": 604, - "content": "Stuff They Don't Want You To Know", "column_max": 830, - "column_min": 226, - "height": 45, "row_min": 1534, - "row_max": 1579 + "column_min": 226 }, { + "height": 29, + "row_max": 1631, + "content": "+ 1.1k", "id": 44, "width": 63, - "content": "+ 1.1k", "column_max": 314, - "column_min": 251, - "height": 29, "row_min": 1602, - "row_max": 1631 + "column_min": 251 }, { + "height": 28, + "row_max": 1631, + "content": "5.4k", "id": 45, "width": 43, - "content": "5.4k", "column_max": 442, - "column_min": 399, - "height": 28, "row_min": 1603, - "row_max": 1631 + "column_min": 399 }, { + "height": 22, + "row_max": 1660, + "content": "howstuffworks.com", "id": 46, "width": 143, - "content": "howstuffworks.com", "column_max": 204, - "column_min": 61, - "height": 22, "row_min": 1638, - "row_max": 1660 + "column_min": 61 }, { + "height": 16, + "row_max": 1724, + "content": "THE", "id": 47, "width": 38, - "content": "THE", "column_max": 152, - "column_min": 114, - "height": 16, "row_min": 1708, - "row_max": 1724 + "column_min": 114 } + ], + "img_shape": [ + 1920, + 1080, + 3 ] } \ No newline at end of file diff --git a/data/output/ocr/497.png b/data/output/ocr/497.png index 49fb310..4d04405 100644 Binary files a/data/output/ocr/497.png and b/data/output/ocr/497.png differ diff --git a/detect_compo/__pycache__/ip_region_proposal.cpython-35.pyc b/detect_compo/__pycache__/ip_region_proposal.cpython-35.pyc index da1616d..7cdd1bd 100644 Binary files a/detect_compo/__pycache__/ip_region_proposal.cpython-35.pyc and b/detect_compo/__pycache__/ip_region_proposal.cpython-35.pyc differ diff --git a/detect_compo/lib_ip/__pycache__/Bbox.cpython-35.pyc b/detect_compo/lib_ip/__pycache__/Bbox.cpython-35.pyc index 210bccd..55b519e 100644 Binary files a/detect_compo/lib_ip/__pycache__/Bbox.cpython-35.pyc and b/detect_compo/lib_ip/__pycache__/Bbox.cpython-35.pyc differ diff --git a/detect_compo/lib_ip/__pycache__/Component.cpython-35.pyc b/detect_compo/lib_ip/__pycache__/Component.cpython-35.pyc index 05614db..57bed21 100644 Binary files a/detect_compo/lib_ip/__pycache__/Component.cpython-35.pyc and b/detect_compo/lib_ip/__pycache__/Component.cpython-35.pyc differ diff --git a/detect_compo/lib_ip/__pycache__/file_utils.cpython-35.pyc b/detect_compo/lib_ip/__pycache__/file_utils.cpython-35.pyc index 8707944..b0c64cb 100644 Binary files a/detect_compo/lib_ip/__pycache__/file_utils.cpython-35.pyc and b/detect_compo/lib_ip/__pycache__/file_utils.cpython-35.pyc differ diff --git a/detect_compo/lib_ip/__pycache__/ip_detection.cpython-35.pyc b/detect_compo/lib_ip/__pycache__/ip_detection.cpython-35.pyc index 51d8c4c..807ce2f 100644 Binary files a/detect_compo/lib_ip/__pycache__/ip_detection.cpython-35.pyc and b/detect_compo/lib_ip/__pycache__/ip_detection.cpython-35.pyc differ diff --git a/detect_compo/lib_ip/__pycache__/ip_draw.cpython-35.pyc b/detect_compo/lib_ip/__pycache__/ip_draw.cpython-35.pyc index de00bad..fe08f64 100644 Binary files a/detect_compo/lib_ip/__pycache__/ip_draw.cpython-35.pyc and b/detect_compo/lib_ip/__pycache__/ip_draw.cpython-35.pyc differ diff --git a/detect_compo/lib_ip/__pycache__/ip_preprocessing.cpython-35.pyc b/detect_compo/lib_ip/__pycache__/ip_preprocessing.cpython-35.pyc index 0652f13..82957d6 100644 Binary files a/detect_compo/lib_ip/__pycache__/ip_preprocessing.cpython-35.pyc and b/detect_compo/lib_ip/__pycache__/ip_preprocessing.cpython-35.pyc differ diff --git a/detect_merge/__pycache__/Element.cpython-35.pyc b/detect_merge/__pycache__/Element.cpython-35.pyc index 6dfbcc6..1b93806 100644 Binary files a/detect_merge/__pycache__/Element.cpython-35.pyc and b/detect_merge/__pycache__/Element.cpython-35.pyc differ diff --git a/detect_merge/__pycache__/merge.cpython-35.pyc b/detect_merge/__pycache__/merge.cpython-35.pyc index 71dc8ad..ceaeaf9 100644 Binary files a/detect_merge/__pycache__/merge.cpython-35.pyc and b/detect_merge/__pycache__/merge.cpython-35.pyc differ diff --git a/detect_text/__pycache__/Text.cpython-35.pyc b/detect_text/__pycache__/Text.cpython-35.pyc index 5cc2071..1167045 100644 Binary files a/detect_text/__pycache__/Text.cpython-35.pyc and b/detect_text/__pycache__/Text.cpython-35.pyc differ diff --git a/detect_text/__pycache__/ocr.cpython-35.pyc b/detect_text/__pycache__/ocr.cpython-35.pyc index e1ceca5..a4bf88c 100644 Binary files a/detect_text/__pycache__/ocr.cpython-35.pyc and b/detect_text/__pycache__/ocr.cpython-35.pyc differ diff --git a/detect_text/__pycache__/text_detection.cpython-35.pyc b/detect_text/__pycache__/text_detection.cpython-35.pyc index 842f3f6..6dfd484 100644 Binary files a/detect_text/__pycache__/text_detection.cpython-35.pyc and b/detect_text/__pycache__/text_detection.cpython-35.pyc differ diff --git a/detect_text/text_detection.py b/detect_text/text_detection.py index 8cc62dd..632704f 100644 --- a/detect_text/text_detection.py +++ b/detect_text/text_detection.py @@ -1,10 +1,12 @@ import detect_text.ocr as ocr from detect_text.Text import Text +import numpy as np import cv2 import json import time import os from os.path import join as pjoin +from paddleocr import PaddleOCR def save_detection_json(file_path, texts, img_shape): @@ -106,6 +108,17 @@ def text_cvt_orc_format(ocr_result): return texts +def text_cvt_orc_format_paddle(paddle_result): + texts = [] + for i, line in enumerate(paddle_result): + points = np.array(line[0]) + location = {'left': int(min(points[:, 0])), 'top': int(min(points[:, 1])), 'right': int(max(points[:, 0])), + 'bottom': int(max(points[:, 1]))} + content = line[1][0] + texts.append(Text(i, content, location)) + return texts + + def text_filter_noise(texts): valid_texts = [] for text in texts: @@ -115,17 +128,32 @@ def text_filter_noise(texts): return valid_texts -def text_detection(input_file='../data/input/30800.jpg', output_file='../data/output', show=False): +def text_detection(input_file='../data/input/30800.jpg', output_file='../data/output', show=False, method='google', paddle_model=None): + ''' + :param method: google or paddle + :param paddle_model: the preload paddle model for paddle ocr + ''' start = time.clock() name = input_file.split('/')[-1][:-4] ocr_root = pjoin(output_file, 'ocr') img = cv2.imread(input_file) - ocr_result = ocr.ocr_detection_google(input_file) - texts = text_cvt_orc_format(ocr_result) - texts = merge_intersected_texts(texts) - texts = text_filter_noise(texts) - texts = text_sentences_recognition(texts) + if method == 'google': + print('*** Detect Text through Google OCR ***') + ocr_result = ocr.ocr_detection_google(input_file) + texts = text_cvt_orc_format(ocr_result) + texts = merge_intersected_texts(texts) + texts = text_filter_noise(texts) + texts = text_sentences_recognition(texts) + elif method == 'paddle': + print('*** Detect Text through Paddle OCR ***') + if paddle_model is None: + paddle_model = PaddleOCR(use_angle_cls=True, lang="ch") + result = paddle_model.ocr(input_file, cls=True) + texts = text_cvt_orc_format_paddle(result) + else: + raise ValueError('Method has to be "google" or "paddle"') + visualize_texts(img, texts, shown_resize_height=800, show=show, write_path=pjoin(ocr_root, name+'.png')) save_detection_json(pjoin(ocr_root, name+'.json'), texts, img.shape) print("[Text Detection Completed in %.3f s] Input: %s Output: %s" % (time.clock() - start, input_file, pjoin(ocr_root, name+'.json'))) diff --git a/run_single.py b/run_single.py index 0f9834e..a22a50f 100644 --- a/run_single.py +++ b/run_single.py @@ -65,7 +65,7 @@ def color_tips(): if is_ocr: import detect_text.text_detection as text os.makedirs(pjoin(output_root, 'ocr'), exist_ok=True) - text.text_detection(input_path_img, output_root, show=True) + text.text_detection(input_path_img, output_root, show=True, method='google') if is_ip: import detect_compo.ip_region_proposal as ip @@ -79,7 +79,7 @@ def color_tips(): classifier['Elements'] = CNN('Elements') # classifier['Noise'] = CNN('Noise') ip.compo_detection(input_path_img, output_root, key_params, - classifier=classifier, resize_by_height=resized_height, show=True) + classifier=classifier, resize_by_height=resized_height, show=False) if is_merge: import detect_merge.merge as merge