Skip to content

ocr

OCRInferenceResponse

Bases: BaseModel

OCR Inference response.

Attributes:

Name Type Description
result str

The OCR recognition result.

time float

The time in seconds it took to produce the inference including preprocessing.

Source code in inference/core/entities/responses/ocr.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
class OCRInferenceResponse(BaseModel):
    """
    OCR Inference response.

    Attributes:
        result (str): The OCR recognition result.
        time: The time in seconds it took to produce the inference including preprocessing.
    """

    result: str = Field(description="The OCR recognition result.")
    time: float = Field(
        description="The time in seconds it took to produce the inference including preprocessing."
    )
    parent_id: Optional[str] = Field(
        description="Identifier of parent image region. Useful when stack of detection-models is in use to refer the RoI being the input to inference",
        default=None,
    )