Use FastAPI to allow sending requests to PaddleOCR service
docker build -t paddle_ocr_restapi:latest -f Dockerfile .- modify host, port and source language in docker-compose.yaml
# default --host 0.0.0.0
# default --port 20000
# default --lang japan
docker compose up -d
# check log under log/ folder- request
curl -X POST "http://localhost:20000/ocr/dict" \
-H "accept: application/json" \
-H "Content-Type: multipart/form-data" \
-F "file=@test.png"- response
with coordinates [x1, y1], [x2, y2], [x3, y3], [x4, y4]
[
{
"transcription": "text1",
"points": [
[],
[],
[],
[]
]
}
]