"""Signature Detection Demo using YOLOS""" import gradio as gr from transformers import pipeline # load the YOLOS model for signature detection pipe = pipeline("object-detection", model="mdefrance/yolos-small-signature-detection") # Create a Gradio interface for the signature detection model interface = gr.Interface.from_pipeline( pipe, title="🖊️ Signature Detection with YOLOS-small", description=( "Upload a scanned document, form, or contract to detect **handwritten signatures** " "using the [YOLOS-small](https://huggingface.co/mdefrance/yolos-small-signature-detection) model. " "This model uses a lightweight vision transformer trained to locate signature bounding boxes." ), examples=[ [ "https://github.com/mdefrance/signature-detection/blob/main/src/datasets/images/examples/val_0.jpg?raw=true" ], [ "https://github.com/mdefrance/signature-detection/blob/main/src/datasets/images/examples/val_15.jpg?raw=true" ], ], inputs=gr.Image(label="📤 Upload Image (JPEG, PNG)", type="pil"), # outputs=gr.Image(label="📍 Detected Signatures"), flagging_mode="never", ) interface.launch()