MarioDEFRANCE
added examples
99f4c7f
"""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()