forked from mawanda-jun/IntelligentOCR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
costants.py
31 lines (23 loc) · 1.07 KB
/
costants.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import os
THREADS = 8
# 1. Read pdf and extract images from it
#TEST_PDF_PATH = os.path.join('pdf/polizze/alupress_cropped.pdf')
#TEST_PDF_PATH = os.path.join('pdf/polizze/unipol_rischi_industriali.pdf')
#TEST_PDF_PATH = os.path.join('pdf/polizze/unipol_all_risks_property_cropped10.pdf')
TEST_PDF_PATH = os.path.join('pdf/polizze/piovan_property4.pdf')
# store here temporary images made by splitting the pdf in singular image files
TEMP_IMG_FOLDER_FROM_PDF = 'tmp'
# extracted images are put in PATH_TO_EXTRACTED_IMAGES. Images quality is: EXTRACTION_DPI = 300
PATH_TO_EXTRACTED_IMAGES = 'extracted_images' # set to - None - if you don't want any
EXTRACTION_DPI = 300
# 2. Find tables and text inside page. Script: find_table.py
# inference graph
INFERENCE_GRAPH = 'inference_graphs/frozen_adam2_tb/frozen_inference_graph.pb'
# table.py uses these constants:
MAX_NUM_BOXES = 10
MIN_SCORE = 0.7
# 3. Extract tables from table images
TABLE_FOLDER = 'table'
TEST_TABLE_PATH = os.path.join('table_pag_4_0.jpeg') # NOT SURE ABOUT THIS
# 4. Extract text from text images
TEXT_FOLDER = 'text'