philschmid / trocr-base-printed

huggingface.co
Total runs: 6
24-hour runs: 0
7-day runs: -5
30-day runs: -8
Model's Last Updated: July 27 2023
image-to-text

Introduction of trocr-base-printed

Model Details of trocr-base-printed

Fork of microsoft/trocr-base-printed for an OCR Inference endpoint.

This repository implements a custom task for ocr-detection for 🤗 Inference Endpoints. The code for the customized pipeline is in the pipeline.py .

To use deploy this model as an Inference Endpoint, you have to select Custom as the task to use the pipeline.py file. -> double check if it is selected

Run Request

The endpoint expects the image to be served as binary . Below is an curl and python example

cURL
  1. get image
wget https://fki.tic.heia-fr.ch/static/img/a01-122-02-00.jpg -O test.jpg
  1. send cURL request
curl --request POST \
  --url https://{ENDPOINT}/ \
  --header 'Content-Type: image/jpg' \
  --header 'Authorization: Bearer {HF_TOKEN}' \
  --data-binary '@test.jpg'
  1. the expected output
{"text": "INDLUS THE"}
Python
  1. get image
wget https://fki.tic.heia-fr.ch/static/img/a01-122-02-00.jpg -O test.jpg
  1. run request
import json
from typing import List
import requests as r
import base64

ENDPOINT_URL=""
HF_TOKEN=""

def predict(path_to_image:str=None):
    with open(path_to_image, "rb") as i:
      b = i.read()
    headers= {
        "Authorization": f"Bearer {HF_TOKEN}",
        "Content-Type": "image/jpeg" # content type of image
    }
    response = r.post(ENDPOINT_URL, headers=headers, data=b)
    return response.json()

prediction = predict(path_to_image="test.jpg")

prediction

expected output

{"text": "INDLUS THE"}

Runs of philschmid trocr-base-printed on huggingface.co

6
Total runs
0
24-hour runs
0
3-day runs
-5
7-day runs
-8
30-day runs

More Information About trocr-base-printed huggingface.co Model

trocr-base-printed huggingface.co

trocr-base-printed huggingface.co is an AI model on huggingface.co that provides trocr-base-printed's model effect (), which can be used instantly with this philschmid trocr-base-printed model. huggingface.co supports a free trial of the trocr-base-printed model, and also provides paid use of the trocr-base-printed. Support call trocr-base-printed model through api, including Node.js, Python, http.

trocr-base-printed huggingface.co Url

https://huggingface.co/philschmid/trocr-base-printed

philschmid trocr-base-printed online free

trocr-base-printed huggingface.co is an online trial and call api platform, which integrates trocr-base-printed's modeling effects, including api services, and provides a free online trial of trocr-base-printed, you can try trocr-base-printed online for free by clicking the link below.

philschmid trocr-base-printed online free url in huggingface.co:

https://huggingface.co/philschmid/trocr-base-printed

trocr-base-printed install

trocr-base-printed is an open source model from GitHub that offers a free installation service, and any user can find trocr-base-printed on GitHub to install. At the same time, huggingface.co provides the effect of trocr-base-printed install, users can directly use trocr-base-printed installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

trocr-base-printed install url in huggingface.co:

https://huggingface.co/philschmid/trocr-base-printed

Url of trocr-base-printed

trocr-base-printed huggingface.co Url

Provider of trocr-base-printed huggingface.co

philschmid
ORGANIZATIONS

Other API from philschmid