applied black
This commit is contained in:
parent
8c916a79c3
commit
ab382646b7
@ -4,7 +4,6 @@ from image_prediction.redai_adapter.model_wrapper import ModelWrapper
|
||||
|
||||
|
||||
class EfficientNetWrapper(ModelWrapper):
|
||||
|
||||
def __init__(self, classes, base_weights_path=None, weights_path=None):
|
||||
self.__input_shape = (224, 224, 3)
|
||||
super().__init__(classes=classes, base_weights_path=base_weights_path, weights_path=weights_path)
|
||||
|
||||
@ -5,7 +5,6 @@ import tensorflow as tf
|
||||
|
||||
|
||||
class ModelWrapper(abc.ABC):
|
||||
|
||||
def __init__(self, classes, base_weights_path=None, weights_path=None):
|
||||
self.__classes = classes
|
||||
self.model = self.__build(base_weights_path)
|
||||
|
||||
@ -4,7 +4,6 @@ from image_prediction.transformer.transformer import Transformer
|
||||
|
||||
|
||||
class CoordinateTransformer(Transformer):
|
||||
|
||||
@abc.abstractmethod
|
||||
def _forward(self, metadata):
|
||||
raise NotImplementedError
|
||||
|
||||
@ -2,7 +2,6 @@ from image_prediction.transformer.transformers.coordinate.coordinate_transformer
|
||||
|
||||
|
||||
class FitzCoordinateTransformer(CoordinateTransformer):
|
||||
|
||||
def _forward(self, metadata: dict):
|
||||
"""Fitz uses top left corner as origin; we take this as the reference coordinate system."""
|
||||
return metadata
|
||||
|
||||
@ -2,7 +2,6 @@ from image_prediction.transformer.transformers.coordinate.coordinate_transformer
|
||||
|
||||
|
||||
class FPDFCoordinateTransformer(CoordinateTransformer):
|
||||
|
||||
def _forward(self, metadata: dict):
|
||||
"""FPDF uses top left corner as origin; we take this as the reference coordinate system."""
|
||||
return metadata
|
||||
|
||||
@ -7,7 +7,6 @@ from image_prediction.transformer.transformers.coordinate.coordinate_transformer
|
||||
|
||||
|
||||
class PDFNetCoordinateTransformer(CoordinateTransformer):
|
||||
|
||||
def _forward(self, metadata: dict):
|
||||
"""PDFNet coordinate system origin is in the bottom left corner."""
|
||||
y1, y2, page_height = itemgetter(Info.Y1, Info.Y2, Info.PAGE_HEIGHT)(metadata)
|
||||
|
||||
@ -54,10 +54,10 @@ def annotate_image(doc, image_info):
|
||||
add_note()
|
||||
|
||||
|
||||
|
||||
def init():
|
||||
PDFNet.Initialize(
|
||||
"Knecon AG(en.knecon.swiss):OEM:DDA-R::WL+:AMS(20211029):BECC974307DAB4F34B513BC9B2531B24496F6FCB83CD8AC574358A959730B622FABEF5C7")
|
||||
"Knecon AG(en.knecon.swiss):OEM:DDA-R::WL+:AMS(20211029):BECC974307DAB4F34B513BC9B2531B24496F6FCB83CD8AC574358A959730B622FABEF5C7"
|
||||
)
|
||||
|
||||
|
||||
def draw_metadata_box(pdf_path, metadata, store_path):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user