Skip to content

Commit e6640b1

Browse files
committed
work
1 parent 19b4d18 commit e6640b1

38 files changed

Lines changed: 1496 additions & 129 deletions

EAST/EAST.pyproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<Content Include="demo_images\img_26.jpg" />
3131
<Content Include="demo_images\img_75.jpg" />
3232
<Content Include="demo_images\web-demo.png" />
33+
<Content Include="pylintrc" />
3334
<Content Include="requirements.txt" />
3435
<Content Include="static\css\app.css" />
3536
<Content Include="templates\index.html" />
@@ -53,7 +54,13 @@
5354
<Compile Include="nets\resnet_utils.py" />
5455
<Compile Include="nets\resnet_v1.py" />
5556
<Compile Include="nets\__init__.py" />
57+
<Compile Include="paragraphs.py">
58+
<SubType>Code</SubType>
59+
</Compile>
5660
<Compile Include="run_demo_server.py" />
61+
<Compile Include="test\test_paragraphs.py">
62+
<SubType>Code</SubType>
63+
</Compile>
5764
<Compile Include="__init__.py" />
5865
</ItemGroup>
5966
<ItemGroup>

EAST/EAST.sln

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "funclib", "..\funclib\funcl
99
EndProject
1010
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "opencvlib", "..\opencvlib\opencvlib.pyproj", "{3791C3EB-165F-4A04-83E2-956959C15823}"
1111
EndProject
12+
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "plotlib", "..\plotlib\plotlib.pyproj", "{008BC738-5450-45B4-9D24-61DE8A3B0096}"
13+
EndProject
1214
Global
1315
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1416
Debug|Any CPU = Debug|Any CPU
@@ -21,6 +23,8 @@ Global
2123
{EC8E1821-0C22-445E-AF07-22BBE247F71E}.Release|Any CPU.ActiveCfg = Release|Any CPU
2224
{3791C3EB-165F-4A04-83E2-956959C15823}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2325
{3791C3EB-165F-4A04-83E2-956959C15823}.Release|Any CPU.ActiveCfg = Release|Any CPU
26+
{008BC738-5450-45B4-9D24-61DE8A3B0096}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
27+
{008BC738-5450-45B4-9D24-61DE8A3B0096}.Release|Any CPU.ActiveCfg = Release|Any CPU
2428
EndGlobalSection
2529
GlobalSection(SolutionProperties) = preSolution
2630
HideSolutionNode = FALSE

EAST/eval.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from icdar import restore_rectangle
2929
from opencvlib import nms
3030

31+
3132
class Flags():
3233
images_path = ''
3334
gpu_list = '0'
@@ -212,7 +213,9 @@ def main():
212213

213214
im_fn_list = get_images()
214215
for im_fn in im_fn_list:
215-
im = cv2.imread(im_fn)[:, :, ::-1]
216+
im = cv2.imread(im_fn)
217+
h, w, _ = im.shape
218+
im = im[:, :, ::-1]
216219
start_time = time.time()
217220
im_resized, (ratio_h, ratio_w) = resize_image(im)
218221

@@ -244,13 +247,16 @@ def main():
244247
continue
245248

246249
box_cv2 = [box.astype(np.int32).reshape((-1, 1, 2))]
247-
250+
248251
if i == 0:
249252
boxes_out = np.array(box_cv2)
253+
#x1, y1, x2, y2, x2 - x1, edge colour
254+
boxes_for_cluster = np.array(box[0, 0]/w, box[0, 1]/h, box[2, 0]/w, box[2, 1]/h, box[2, 1]/h - box[0, 1]/h)
255+
# for_cluster = np.array(box[0, 0], box[0, 1], box[1, 0], box[1, 1], box[2, 0], box[2, 1], box[3, 0], box[3, 1])
250256
else:
251257
boxes_out = np.vstack((boxes_out, np.array(box_cv2)))
252258

253-
#f.write('{},{},{},{},{},{},{},{}\r\n'.format(box[0, 0], box[0, 1], box[1, 0], box[1, 1], box[2, 0], box[2, 1], box[3, 0], box[3, 1],))
259+
#f.write('{},{},{},{},{},{},{},{}\r\n'.format(,))
254260
if FLAGS.write_images:
255261
cv2.polylines(im[:, :, ::-1], box_cv2, True, color=(255, 255, 0), thickness=1)
256262
np.save(res_file_pickle, boxes_out)

EAST/paragraphs.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# pylint: disable=C0103, too-few-public-methods, locally-disabled, no-self-use, unused-argument
2+
'''identify paragarphs'''
3+
4+
5+
6+
import numpy as _np
7+
8+
from sklearn.cluster import DBSCAN as _DBSCAN
9+
from sklearn import metrics as _metrics
10+
from sklearn.datasets.samples_generator import make_blobs
11+
from sklearn.preprocessing import StandardScaler
12+
13+
14+
15+
16+

0 commit comments

Comments
 (0)