MarioDEFRANCE commited on
Commit
99f4c7f
Β·
1 Parent(s): e2779a5

added examples

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -4,28 +4,28 @@ import gradio as gr
4
 
5
  from transformers import pipeline
6
 
7
- # load the YOLOs model for signature detection
8
- pipe = pipeline("object-detection", model="mdefrance/yolos-tiny-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-Tiny",
14
  description=(
15
  "Upload a scanned document, form, or contract to detect **handwritten signatures** "
16
- "using the [YOLOS-tiny](https://huggingface.co/mdefrance/yolos-tiny-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_15.jpg?raw=true"
22
  ],
23
  [
24
- "https://github.com/mdefrance/signature-detection/blob/main/src/datasets/images/examples/val_0.jpg?raw=true"
25
  ],
26
  ],
27
  inputs=gr.Image(label="πŸ“€ Upload Image (JPEG, PNG)", type="pil"),
28
- outputs=gr.Image(label="πŸ“ Detected Signatures"),
29
- allow_flagging="never",
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()