bscheibel 4 years ago
parent
commit
ef0f603f99
4 changed files with 6 additions and 14 deletions
  1. 0 1
      Pipfile
  2. 1 8
      Pipfile.lock
  3. 4 4
      main.py
  4. 1 1
      order_bounding_boxes_in_each_block.py

+ 0 - 1
Pipfile

@@ -11,7 +11,6 @@ numpy = "*"
 pandas = "*"
 sklearn = "*"
 redis = "*"
-pdftotext = "*"
 
 [requires]
 python_version = "3.7"

+ 1 - 8
Pipfile.lock

@@ -1,7 +1,7 @@
 {
     "_meta": {
         "hash": {
-            "sha256": "ee3243d7339bb338000aab519e3cc0313391b97c6dd556c363dc1ce60a42454e"
+            "sha256": "d3049a4774aee96ad8f4b61b6c2c8ddbf88879362c000f6e9511bd0cdb89561d"
         },
         "pipfile-spec": 6,
         "requires": {
@@ -90,13 +90,6 @@
             "index": "pypi",
             "version": "==0.25.3"
         },
-        "pdftotext": {
-            "hashes": [
-                "sha256:c8bdc47b08baa17b8e03ba1f960fc6335b183d2644eaf7300e088516758a6090"
-            ],
-            "index": "pypi",
-            "version": "==2.1.2"
-        },
         "python-dateutil": {
             "hashes": [
                 "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c",

+ 4 - 4
main.py

@@ -26,7 +26,7 @@ def main(uuid, filepath, db, eps):
     isos, general_tol = order_bounding_boxes_in_each_block.extract_isos(result)
     print(general_tol)
     res = clustering_precomputed_dbscan.cluster_and_preprocess(result,eps)
-    clean_arrays = read_from_clustered_merged.read("/home/bscheibel/PycharmProjects/dxf_reader/temporary/values_clusteredfrom_precomputed_dbscan.csv")
+    clean_arrays = read_from_clustered_merged.read("/home/centurio/Projects/engineering_drawings_extraction/temporary/values_clusteredfrom_precomputed_dbscan.csv")
     tables = order_bounding_boxes_in_each_block.get_tables(clean_arrays)
     pretty = regex_clean_new.print_clean(clean_arrays)
     res, details_dict = organize_drawing_according_to_details_new.main_function(pretty, tables)
@@ -44,11 +44,11 @@ def main(uuid, filepath, db, eps):
     #print(redis.Redis('localhost').get(uuid+"dims"))
     #print(result)
 
-if __name__ == "__main__":
+"""if __name__ == "__main__":
     uuid = sys.argv[1]
     filename = sys.argv[2]
     db = sys.argv[3]
     eps = sys.argv[4]
     main(uuid,filename, db, eps)
-
-#main("33333", "/home/bscheibel/PycharmProjects/dxf_reader/drawings/5152166_Rev04.pdf", "localhost",3)
+"""
+main("33333", "/home/bscheibel/PycharmProjects/dxf_reader/drawings/5152166_Rev04.pdf", "localhost",3)

+ 1 - 1
order_bounding_boxes_in_each_block.py

@@ -55,7 +55,7 @@ def get_bound_box(file):
     return new_all_elements, number_blocks, number_words
 
 def pdf_to_html(uuid,filepath):
-    filename = "app/temporary/" +str(uuid)+"out.html"
+    filename = "temporary/" +str(uuid)+"out.html" #to app/temporary later
     subprocess.call(['pdftotext', '-bbox-layout',
                      filepath, filename])
     return filename