Itrp Demo
POST
/itrp/demo
const url = 'https://example.com/itrp/demo';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"image":"example","source_lang":"example","target_lang":"example","ocr_model":"paddleocr-vl","ocr_variant":"example","translation_model":"hunyuanmt-7b","translation_variant":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/itrp/demo \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "image": "example", "source_lang": "example", "target_lang": "example", "ocr_model": "paddleocr-vl", "ocr_variant": "example", "translation_model": "hunyuanmt-7b", "translation_variant": "example" }'Submit an image for OCR → translate → overlay rendering.
Returns 202 immediately with a task_id. Poll GET /itrp/demo/{task_id} for the result. The Celery worker handles model warmup, OCR blocks, translation, and overlay in sequence.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
ITRPDemoRequest
object
image
required
Image
Base64-encoded image (JPEG or PNG)
string
source_lang
required
Source Lang
Source language code
string
target_lang
required
Target Lang
Target language code
string
ocr_model
Ocr Model
Registered OCR model name
string
translation_model
Translation Model
Registered translation model name
string
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
ITRPDemoSubmission
object
task_id
required
Task Id
Celery task ID for tracking the ITRP job
string
status
Status
Initial status of the task
string
Example
{ "status": "queued"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}