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
import json
from typing importListimport requests as r
import base64
ENDPOINT_URL=""
HF_TOKEN=""defpredict(path_to_image:str=None):
withopen(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 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:
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.