浏览代码

点到线识别

luojiehua 2 年之前
父节点
当前提交
6f30a469ae
共有 4 个文件被更改,包括 150 次插入18 次删除
  1. 1 1
      format_convert/convert_need_interface.py
  2. 16 16
      idc/idc_interface.py
  3. 1 1
      otr/table_line.py
  4. 132 0
      requirements.txt

+ 1 - 1
format_convert/convert_need_interface.py

@@ -17,7 +17,7 @@ import cv2
 import redis
 from werkzeug.exceptions import NotFound
 
-from idc.idc_interface import IdcModels, idc
+# from idc.idc_interface import IdcModels, idc
 
 sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../")
 

+ 16 - 16
idc/idc_interface.py

@@ -12,7 +12,7 @@ from format_convert import _global
 import cv2
 import numpy as np
 from PIL import Image
-from idc.model import direction_model
+# from idc.model import direction_model
 from format_convert.utils import log, get_md5_from_bytes, request_post, np2pil, bytes2np, pil2np, pil_resize, np2bytes
 import tensorflow as tf
 from flask import Flask, request
@@ -108,21 +108,21 @@ def _idc():
         log("idc interface finish time " + str(time.time()-start_time))
 
 
-class IdcModels:
-    def __init__(self):
-        # python文件所在目录
-        _dir = os.path.abspath(os.path.dirname(__file__))
-
-        # detect
-        model_path = _dir + "/models/model.h5"
-        with sess.as_default():
-            with sess.graph.as_default():
-                self.model = direction_model(input_shape=(image_shape[0], image_shape[1], 3),
-                                             output_shape=4)
-                self.model.load_weights(model_path)
-
-    def get_model(self):
-        return self.model
+# class IdcModels:
+#     def __init__(self):
+#         # python文件所在目录
+#         _dir = os.path.abspath(os.path.dirname(__file__))
+#
+#         # detect
+#         model_path = _dir + "/models/model.h5"
+#         with sess.as_default():
+#             with sess.graph.as_default():
+#                 self.model = direction_model(input_shape=(image_shape[0], image_shape[1], 3),
+#                                              output_shape=4)
+#                 self.model.load_weights(model_path)
+#
+#     def get_model(self):
+#         return self.model
 
 
 def test_idc_model(from_remote=False):

+ 1 - 1
otr/table_line.py

@@ -405,7 +405,7 @@ def lines_cluster(list_lines,line_width):
         list_lines = c_lines
     return c_lines
 
-
+ 
 
 def points2lines(pred,sourceP_LB=True, prob=0.2, line_width=8, padding=3, min_len=10,
                   cell_width=13):

+ 132 - 0
requirements.txt

@@ -0,0 +1,132 @@
+absl-py==0.13.0
+aliyun-python-sdk-core==2.13.35
+aliyun-python-sdk-kms==2.15.0
+asgiref==3.4.1
+astor==0.8.1
+astunparse==1.6.3
+async-timeout==4.0.2
+attrs==21.2.0
+beautifulsoup4==4.9.3
+cached-property==1.5.2
+cachetools==4.2.2
+certifi==2021.5.30
+cffi==1.14.6
+chardet==4.0.0
+charset-normalizer==2.0.12
+clang==5.0
+cli-exit-tools==1.2.3
+click==8.0.1
+colorama==0.4.4
+crcmod==1.7
+cryptography==37.0.2
+cssselect==1.1.0
+cssutils==2.3.0
+cycler==0.10.0
+decorator==4.4.2
+Deprecated==1.2.13
+dill==0.3.4
+Django==3.2.5
+et-xmlfile==1.1.0
+filetype==1.0.7
+Flask==2.0.1
+flatbuffers==1.12
+gast==0.4.0
+google-auth==1.32.0
+google-auth-oauthlib==0.4.4
+google-pasta==0.2.0
+graphviz==0.20
+grpcio==1.46.3
+gunicorn==20.1.0
+h5py==3.1.0
+idna==2.10
+image==1.5.33
+imageio==2.9.0
+imgaug==0.4.0
+importlib-metadata==4.5.0
+itsdangerous==2.0.1
+Jinja2==3.0.1
+jmespath==0.10.0
+joblib==1.0.1
+JsonForm==0.0.2
+jsonschema==3.2.0
+JsonSir==0.0.2
+keras==2.6.0
+Keras-Applications==1.0.8
+keras-nightly==2.5.0.dev2021032900
+Keras-Preprocessing==1.1.2
+kiwisolver==1.3.1
+lib-detect-testenv==2.0.2
+lmdb==1.2.1
+lxml==4.6.3
+Markdown==3.3.4
+MarkupSafe==2.0.1
+matplotlib==3.4.2
+multiprocess==0.70.12.2
+networkx==2.5.1
+numpy==1.19.5
+oauthlib==3.1.1
+objgraph==3.5.0
+opencv-python==4.5.2.54
+openpyxl==3.0.9
+opt-einsum==3.3.0
+oss2==2.14.0
+packaging==21.3
+paddlepaddle==2.1.0
+pandas==1.2.5
+pdfminer==20191125
+pdfminer.six==20220524
+pdfplumber==0.6.0
+Pillow==9.0.1
+premailer==3.10.0
+protobuf==3.17.3
+psutil==5.8.0
+pyasn1==0.4.8
+pyasn1-modules==0.2.8
+pyclipper==1.2.1
+pycparser==2.20
+pycryptodome==3.10.1
+PyMuPDF==1.18.14
+pyparsing==2.4.7
+PyPDF2==1.26.0
+pyrsistent==0.18.0
+python-dateutil==2.8.1
+python-docx==0.8.11
+Python-EasyConfig==0.1.7
+pytz==2021.1
+PyWavelets==1.1.1
+PyYAML==5.4.1
+rarfile==4.0
+redis==4.3.1
+requests==2.25.1
+requests-oauthlib==1.3.0
+Resource==0.2.1
+rsa==4.7.2
+scikit-image==0.18.1
+scikit-learn==0.24.2
+scipy==1.4.1
+Shapely==1.7.1
+six==1.15.0
+sklearn==0.0
+soupsieve==2.2.1
+sqlparse==0.4.1
+tensorboard==2.9.1
+tensorboard-data-server==0.6.1
+tensorboard-plugin-wit==1.8.0
+tensorflow==2.4.1
+tensorflow-estimator==2.9.0
+tensorflow-gpu==2.6.0
+termcolor==1.1.0
+threadpoolctl==2.2.0
+tifffile==2021.6.14
+timeout-decorator==0.5.0
+tqdm==4.61.1
+typing-extensions==3.7.4.3
+unrar==0.4
+urllib3==1.26.5
+Wand==0.6.7
+Werkzeug==2.0.1
+wincertstore==0.2
+wrapt==1.12.1
+wrapt-timeout-decorator==1.3.8
+xlrd==1.2.0
+zipp==3.4.1