StabRise/signature_detection_v0.1
190
SignatureDetector
Overview
SignatureDetector is a signature detection transformer based on the YOLO ONNX model. It efficiently detects signatures in images using a pre-trained model from Hugging Face Hub. The detector is implemented as a PySpark ML transformer and can be integrated into Spark pipelines for scalable signature detection tasks in ScaleDP.
Documentation: https://scaledp.stabrise.com/en/latest/models/detectors/signature_detector.html
Model is using in: https://pdf-redaction.com/redaction/
## Usage Example
Full example notebook: https://github.com/StabRise/ScaleDP-Tutorials/blob/master/object-detection/3.SignatureDetection.ipynb
from scaledp import SignatureDetector, ImageDrawBoxes, PipelineModel
detector = SignatureDetector(
keepInputData=True,
partitionMap=True,
numPartitions=0,
scoreThreshold=0.25,
task="detect",
padding=20,
)
draw = ImageDrawBoxes(
keepInputData=True,
inputCols=["image", "signatures"],
filled=False,
color="blue",
lineWidth=5,
displayDataList=[],
)
# Transform the image dataframe through the signature detection stage
pipeline = PipelineModel(stages=[detector, draw])
result = pipeline.transform(image_df)
Parameters
Notes
- The detector uses the YOLO ONNX pretrained model.
- Supports batch processing and distributed inference with Spark.
- Additional parameters can be set using the corresponding setter methods.
