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.
1from scaledp import SignatureDetector, ImageDrawBoxes, PipelineModel
2
3detector = SignatureDetector(
4 keepInputData=True,
5 partitionMap=True,
6 numPartitions=0,
7 scoreThreshold=0.25,
8 task="detect",
9 padding=20,
10)
11
12draw = ImageDrawBoxes(
13 keepInputData=True,
14 inputCols=["image", "signatures"],
15 filled=False,
16 color="blue",
17 lineWidth=5,
18 displayDataList=[],
19)
20# Transform the image dataframe through the signature detection stage
21pipeline = PipelineModel(stages=[detector, draw])
22result = pipeline.transform(image_df)