Step 1: Install required Python dependencies
Set up the required Python dependencies before starting.Step 2: Prepare the Input Payload
Holo1.5 is hosted on H Company’s inference platform and is compatible with the OpenAI Chat Completions API protocol. In this example, Holo1.5 is prompted to identify the correct location to click in order to successfully select a date on the calendar. Important: The input image must be resized using Qwen’ssmart_resize
method. This is crucial because the served model performs its own internal resizing, which can alter the original image dimensions and lead to inaccurate or misaligned coordinate predictions from the model.
Step 3: Invoke Holo1.5 via API
This section shows you how to call the Holo1.5 model via API to perform a localization task.Step 3a: Set up your API key
You can provide the API key in two ways:- Directly by assigning it to the
API_KEY
variable. - Indirectly by adding it to a .env file under the variable name
HAI_API_KEY
.
Step 3b: Set up the model
Prepare the model endpoint by providing the model name and base URL.Step 3c: Invoke the model
Send the image and task to the model via the API, then handle and display the model’s output.