Skip to content

Aliases

resolve_ocr_path(model_name)

Resolve an OCR model name to its corresponding endpoint path.

Parameters:

Name Type Description Default
model_name str

The name of the OCR model.

required

Returns:

Type Description
str

The endpoint path for the OCR model.

Source code in inference_sdk/http/utils/aliases.py
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
def resolve_ocr_path(model_name: str) -> str:
    """Resolve an OCR model name to its corresponding endpoint path.

    Args:
        model_name: The name of the OCR model.

    Returns:
        The endpoint path for the OCR model.
    """
    model_name = model_name.lower()
    if model_name not in OCR_ENDPOINTS:
        raise ValueError(f"OCR not supported: {model_name}")
    return OCR_ENDPOINTS[model_name]

resolve_roboflow_model_alias(model_id)

Resolve a Roboflow model alias to a registered model ID.

Parameters:

Name Type Description Default
model_id str

The model alias to resolve.

required

Returns:

Type Description
str

The registered model ID.

Source code in inference_sdk/http/utils/aliases.py
85
86
87
88
89
90
91
92
93
94
def resolve_roboflow_model_alias(model_id: str) -> str:
    """Resolve a Roboflow model alias to a registered model ID.

    Args:
        model_id: The model alias to resolve.

    Returns:
        The registered model ID.
    """
    return REGISTERED_ALIASES.get(model_id, model_id)