Commit c532090f authored by Alexander Gehrke's avatar Alexander Gehrke

Refactor and cleanup

parent 3484f3bf
......@@ -256,7 +256,7 @@ def create_predictions(model, image_path, binary_path, char_height, target_line_
def create_pagexml(result: SegmentationResult, output_dir: Optional[str] = None):
import pypagexml as pxml
meta = pxml.ds.MetadataTypeSub(Creator="ocr4all_pixel_classifier", Created=pxml.ds.iso_now())
meta = pxml.ds.MetadataTypeSub(Creator="ocr4all_pixel_classifier_frontend", Created=pxml.ds.iso_now())
doc = pxml.new_document_from_image(result.path, meta)
def add_segment(segment: AnyRegion, index: int, idprefix: str, region_type: Type,
......
......@@ -5,52 +5,52 @@ import importlib
commands = {
'train': {
'script': 'ocr4all_pixel_classifier.scripts.train',
'script': 'ocr4all_pixel_classifier_frontend.train',
'main': 'main',
'help': 'Train the neural network. See more via "* train --help"'
},
'predict': {
'script': 'ocr4all_pixel_classifier.scripts.predict',
'script': 'ocr4all_pixel_classifier_frontend.predict',
'main': 'main',
'help': 'Predict a result with the neural network. See more via "* predict --help"'
},
'predict-json': {
'script': 'ocr4all_pixel_classifier.scripts.predict_json',
'script': 'ocr4all_pixel_classifier_frontend.predict_json',
'main': 'main',
'help': 'Predict a result with the neural network, input via JSON. See more via "* predict --help"'
},
'create-dataset-file': {
'script': 'ocr4all_pixel_classifier.scripts.create_dataset_file',
'script': 'ocr4all_pixel_classifier_frontend.create_dataset_file',
'main': 'main',
'help': 'Create a dataset file'
},
'compute-image-normalizations': {
'script': 'ocr4all_pixel_classifier.scripts.compute_image_normalizations',
'script': 'ocr4all_pixel_classifier_frontend.compute_image_normalizations',
'main': 'main',
'help': 'Compute image normalizations'
},
'compute-image-map': {
'script': 'ocr4all_pixel_classifier.scripts.generate_image_map',
'script': 'ocr4all_pixel_classifier_frontend.generate_image_map',
'main': 'main',
'help': 'Generates color map'
},
'migrate-model': {
'script': 'ocr4all_pixel_classifier.scripts.migrate_model',
'script': 'ocr4all_pixel_classifier_frontend.migrate_model',
'main': 'main',
'help': 'Convert old model to new format'
},
'gen-masks': {
'script': 'ocr4all_pixel_classifier.scripts.gen_masks',
'script': 'ocr4all_pixel_classifier_frontend.gen_masks',
'main': 'main',
'help': 'Generate mask images from PAGE XML'
},
'find-segments': {
'script': 'ocr4all_pixel_classifier.scripts.find_segments',
'script': 'ocr4all_pixel_classifier_frontend.find_segments',
'main': 'main',
'help': 'Run a prediction and region segmentation'
},
'eval': {
'script': 'ocr4all_pixel_classifier.scripts.evaluate',
'script': 'ocr4all_pixel_classifier_frontend.evaluate',
'main': 'main',
'help': 'Evaluate a model'
},
......
......@@ -4,8 +4,8 @@ with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='ocr4all_pixel_classifier',
version='0.3.0',
name='ocr4all_pixel_classifier_frontend',
version='0.4.0',
packages=find_packages(),
long_description=long_description,
......@@ -16,8 +16,8 @@ setup(
url="https://gitlab2.informatik.uni-wuerzburg.de/chw71yx/page-segmentation.git",
entry_points={
'console_scripts': [
'ocr4all-pixel-classifier=ocr4all_pixel_classifier.scripts.main:main',
'page-segmentation=ocr4all_pixel_classifier.scripts.main:main', # legacy
'ocr4all-pixel-classifier=ocr4all_pixel_classifier_frontend.main:main',
'page-segmentation=ocr4all_pixel_classifier_frontend.main:main', # legacy
],
},
install_requires=open("requirements.txt").read().split(),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment