-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Hedgehogues/change-versions
Change versions
- Loading branch information
Showing
41 changed files
with
1,494 additions
and
858 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,6 @@ data/dev/fonts_dataset/ | |
*/__pycache__/ | ||
*.pyc | ||
*~* | ||
build/ | ||
*.egg-info/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM ubuntu:18.04 AS BUILD | ||
|
||
RUN apt-get -y update | ||
RUN apt-get install -y gcc python3 python3-pip python3-dev cmake make libsm6 libxext6 libxrender-dev | ||
RUN apt-get install -y git | ||
|
||
RUN git clone https://github.com/opencv/opencv.git | ||
WORKDIR /opencv/build | ||
RUN cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local .. | ||
RUN make -j4 | ||
RUN make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from hochiminh import pdf_parser | ||
from hochiminh.image_processing import hochiminh | ||
from hochiminh.image_processing.connected_components import ConnectedComponents | ||
from hochiminh.image_processing.cross_detector import CrossDetector | ||
from hochiminh.image_processing.lines_detector import SobelDirector | ||
from hochiminh.image_processing.ocr import TesseractWrapper | ||
from hochiminh.io import pdfconverter, reader | ||
|
||
path = "../data/test/ho_chi_minh/" | ||
parser = pdf_parser.PDFParser( | ||
table_extractor=hochiminh.HoChiMinh( | ||
reader=reader.ImagePDFReader( | ||
pdfconverter.PDFConverter(in_path=path + 'pdf/', out_path=path + 'pdf/images/', resolution=130) | ||
), | ||
lines_detector=SobelDirector(), | ||
connected_components=ConnectedComponents(), | ||
cross_detector=CrossDetector(max_steps=20, detected_steps=18, line_width=8), | ||
ocr=TesseractWrapper(), | ||
binarization=210 | ||
) | ||
) | ||
|
||
tabels = parser.extract_table() | ||
for tabel in tabels: | ||
print('--------------- Table ---------------') | ||
for cell in tabel: | ||
print(cell.__dict__) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
Empty file.
2 changes: 1 addition & 1 deletion
2
.../image_processing/connected_components.py → .../image_processing/connected_components.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
internal/image_processing/cross_detector.py → hochiminh/image_processing/cross_detector.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule OTR
deleted from
8f2654
Submodule ocropy
deleted from
d3e5cc
Submodule unet
deleted from
4b939a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
opencv-python==3.4.2.17 | ||
scikit-learn==0.21.0 | ||
scikit-image==0.16.2 | ||
pytesseract==0.2.0 | ||
scipy==1.3.1 | ||
pdf2image==0.1.9 | ||
xlrd==1.1.0 | ||
pillow==5.2.0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,42 @@ | ||
from setuptools import setup | ||
|
||
PACKAGE = "HoChiMinh" | ||
NAME = "HoChiMinh" | ||
DESCRIPTION = "Ho Chi Minh is designed to extract textual information from tables presented in PDF, pictures or " \ | ||
"other format. Хошимин предназначен для извлечения текстовой информации из таблиц, представленных в " \ | ||
"PDF, картинках или ином формате." | ||
AUTHOR = "Egor Urvanov" | ||
AUTHOR_EMAIL = "hedgehogues@bk.ru" | ||
URL = "https://github.com/Hedgehogues/HoChiMinh" | ||
req = open('requirements.txt').readlines() | ||
|
||
setup( | ||
name=NAME, | ||
description=DESCRIPTION, | ||
author=AUTHOR, | ||
author_email=AUTHOR_EMAIL, | ||
license="MIT", | ||
url=URL, | ||
install_requiers=req, | ||
) | ||
import setuptools | ||
try: | ||
from pip._internal import main as pipmain | ||
except: | ||
print('your version of pip is deprecated') | ||
from pip import main as pipmain | ||
|
||
|
||
class InternalRequirements: | ||
pass | ||
|
||
|
||
def parse_requirements(filename): | ||
""" load requirements from a pip requirements file """ | ||
lineiter = (line.strip() for line in open(filename)) | ||
return [line for line in lineiter if line and not line.startswith("#")] | ||
|
||
|
||
with open("README.md", "r") as fh: | ||
long_description = fh.read() | ||
|
||
install_reqs = parse_requirements('./requirements') | ||
print(f'public requirements: {install_reqs}') | ||
|
||
kwargs = { | ||
'name': "HoChiMinh", | ||
'version': "1.0.0", | ||
'author': 'Egor Urvanov', | ||
'author_email': 'hedgehogues@bk.ru', | ||
'description': 'Ho Chi Minh is designed to extract textual information from tables presented in PDF, pictures or other format. Хошимин предназначен для извлечения текстовой информации из таблиц, представленных в PDF, картинках или ином формате.', | ||
'long_description': long_description, | ||
'long_description_content_type': 'text/markdown', | ||
'url': 'https://github.com/Hedgehogues/HoChiMinh', | ||
'packages': setuptools.find_packages(), | ||
'classifiers': [ | ||
"Programming Language :: Python :: 3.7", | ||
"Operating System :: OS Independent", | ||
], | ||
'install_requires': install_reqs, | ||
} | ||
|
||
setuptools.setup(**kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters