Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ processor = TrOCRProcessor.from_pretrained("microsoft/trocr-base-str")
|
|
7 |
model = VisionEncoderDecoderModel.from_pretrained("microsoft/trocr-base-str")
|
8 |
|
9 |
# load image examples
|
10 |
-
urls = ['https://
|
11 |
for idx, url in enumerate(urls):
|
12 |
image = Image.open(requests.get(url, stream=True).raw)
|
13 |
image.save(f"image_{idx}.png")
|
@@ -27,7 +27,7 @@ def process_image(image):
|
|
27 |
title = "Interactive demo: Scene Text Recognition with TrOCR"
|
28 |
description = "Demo for Microsoft's TrOCR, an encoder-decoder model consisting of an image Transformer encoder and a text Transformer decoder for state-of-the-art optical character recognition (OCR) on single-text line images. This particular model is fine-tuned for scene text recognition. To use it, simply upload a (single-text line) image or use one of the example images below and click 'submit'. Results will show up in a few seconds."
|
29 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2109.10282'>TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models</a> | <a href='https://github.com/microsoft/unilm/tree/master/trocr'>Github Repo</a></p>"
|
30 |
-
examples =[["image_0.png"]]
|
31 |
|
32 |
#css = """.output_image, .input_image {height: 600px !important}"""
|
33 |
|
|
|
7 |
model = VisionEncoderDecoderModel.from_pretrained("microsoft/trocr-base-str")
|
8 |
|
9 |
# load image examples
|
10 |
+
urls = ['https://raw.githubusercontent.com/ku21fan/STR-Fewer-Labels/main/demo_image/1.png', 'https://raw.githubusercontent.com/ku21fan/STR-Fewer-Labels/main/demo_image/9.jpg', 'https://raw.githubusercontent.com/HCIILAB/Scene-Text-Recognition-Recommendations/main/Dataset_images/ArT2.jpg']
|
11 |
for idx, url in enumerate(urls):
|
12 |
image = Image.open(requests.get(url, stream=True).raw)
|
13 |
image.save(f"image_{idx}.png")
|
|
|
27 |
title = "Interactive demo: Scene Text Recognition with TrOCR"
|
28 |
description = "Demo for Microsoft's TrOCR, an encoder-decoder model consisting of an image Transformer encoder and a text Transformer decoder for state-of-the-art optical character recognition (OCR) on single-text line images. This particular model is fine-tuned for scene text recognition. To use it, simply upload a (single-text line) image or use one of the example images below and click 'submit'. Results will show up in a few seconds."
|
29 |
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2109.10282'>TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models</a> | <a href='https://github.com/microsoft/unilm/tree/master/trocr'>Github Repo</a></p>"
|
30 |
+
examples =[["image_0.png"], ["image_1.png"], ["image_2.png"]]
|
31 |
|
32 |
#css = """.output_image, .input_image {height: 600px !important}"""
|
33 |
|