Spaces:
Runtime error
Runtime error
Msp Raja
commited on
Commit
•
a5f93a1
1
Parent(s):
6b34305
initial commit
Browse files- app.py +16 -0
- form.jpeg +0 -0
- handwritten.jpeg +0 -0
- invoice.jpeg +0 -0
- news.jpeg +0 -0
- questionaire.jpeg +0 -0
- requirements.txt +3 -0
- resume.jpeg +0 -0
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
title = "Document Image Transformer"
|
5 |
+
description = "Gradio Demo for DiT, the Document Image Transformer pre-trained on IIT-CDIP, a dataset that includes 42 million document images and fine-tuned on RVL-CDIP, a dataset consisting of 400,000 grayscale images in 16 classes, with 25,000 images per class. To use it, simply add your image, or click one of the examples to load them. Read more at the links below."
|
6 |
+
article = "<p style='text-align: center'><a href='https://huggingface.co/microsoft/dit-base-finetuned-rvlcdip' target='_blank'>Huggingface Model</a></p>"
|
7 |
+
|
8 |
+
pipe = pipeline(task="image-classification",
|
9 |
+
model="microsoft/dit-base-finetuned-rvlcdip")
|
10 |
+
gr.Interface.from_pipeline(pipe,
|
11 |
+
title=title,
|
12 |
+
description=description,
|
13 |
+
examples=[ 'handwritten.jpeg', 'invoice.jpeg'],
|
14 |
+
article=article,
|
15 |
+
enable_queue=True,
|
16 |
+
).launch()
|
form.jpeg
ADDED
![]() |
handwritten.jpeg
ADDED
![]() |
invoice.jpeg
ADDED
![]() |
news.jpeg
ADDED
![]() |
questionaire.jpeg
ADDED
![]() |
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
torch
|
3 |
+
transformers
|
resume.jpeg
ADDED
![]() |