nielsr HF staff commited on
Commit
9aade84
1 Parent(s): 85c054d

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ title = "Document Image Transformer"
4
+ 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."
5
+
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
+ examples = [
9
+ ["lion.jpg"]
10
+ ]
11
+
12
+ gr.Interface.load("huggingface/microsoft/dit-base-finetuned-rvlcdip",
13
+ title=title,
14
+ description=description,
15
+ article=article,
16
+ examples=examples,
17
+ enable_queue=True).launch()