Spaces:
Sleeping
Sleeping
MarioDEFRANCE
commited on
Commit
Β·
99f4c7f
1
Parent(s):
e2779a5
added examples
Browse files
app.py
CHANGED
|
@@ -4,28 +4,28 @@ import gradio as gr
|
|
| 4 |
|
| 5 |
from transformers import pipeline
|
| 6 |
|
| 7 |
-
# load the
|
| 8 |
-
pipe = pipeline("object-detection", model="mdefrance/yolos-
|
| 9 |
|
| 10 |
# Create a Gradio interface for the signature detection model
|
| 11 |
interface = gr.Interface.from_pipeline(
|
| 12 |
pipe,
|
| 13 |
-
title="ποΈ Signature Detection with YOLOS-
|
| 14 |
description=(
|
| 15 |
"Upload a scanned document, form, or contract to detect **handwritten signatures** "
|
| 16 |
-
"using the [YOLOS-
|
| 17 |
"This model uses a lightweight vision transformer trained to locate signature bounding boxes."
|
| 18 |
),
|
| 19 |
examples=[
|
| 20 |
[
|
| 21 |
-
"https://github.com/mdefrance/signature-detection/blob/main/src/datasets/images/examples/
|
| 22 |
],
|
| 23 |
[
|
| 24 |
-
"https://github.com/mdefrance/signature-detection/blob/main/src/datasets/images/examples/
|
| 25 |
],
|
| 26 |
],
|
| 27 |
inputs=gr.Image(label="π€ Upload Image (JPEG, PNG)", type="pil"),
|
| 28 |
-
outputs=gr.Image(label="π Detected Signatures"),
|
| 29 |
-
|
| 30 |
)
|
| 31 |
interface.launch()
|
|
|
|
| 4 |
|
| 5 |
from transformers import pipeline
|
| 6 |
|
| 7 |
+
# load the YOLOS model for signature detection
|
| 8 |
+
pipe = pipeline("object-detection", model="mdefrance/yolos-small-signature-detection")
|
| 9 |
|
| 10 |
# Create a Gradio interface for the signature detection model
|
| 11 |
interface = gr.Interface.from_pipeline(
|
| 12 |
pipe,
|
| 13 |
+
title="ποΈ Signature Detection with YOLOS-small",
|
| 14 |
description=(
|
| 15 |
"Upload a scanned document, form, or contract to detect **handwritten signatures** "
|
| 16 |
+
"using the [YOLOS-small](https://huggingface.co/mdefrance/yolos-small-signature-detection) model. "
|
| 17 |
"This model uses a lightweight vision transformer trained to locate signature bounding boxes."
|
| 18 |
),
|
| 19 |
examples=[
|
| 20 |
[
|
| 21 |
+
"https://github.com/mdefrance/signature-detection/blob/main/src/datasets/images/examples/val_0.jpg?raw=true"
|
| 22 |
],
|
| 23 |
[
|
| 24 |
+
"https://github.com/mdefrance/signature-detection/blob/main/src/datasets/images/examples/val_15.jpg?raw=true"
|
| 25 |
],
|
| 26 |
],
|
| 27 |
inputs=gr.Image(label="π€ Upload Image (JPEG, PNG)", type="pil"),
|
| 28 |
+
# outputs=gr.Image(label="π Detected Signatures"),
|
| 29 |
+
flagging_mode="never",
|
| 30 |
)
|
| 31 |
interface.launch()
|