Blocks inference until results moves to the final state and are available.

EdgeClient.inferences.block_until_complete(inference_identifier, poll_interval=0.01, timeout=30)

This method blocks the execution until the result of an inference is marked as finished or it reaches the timeout seconds (if it is different than None). It refreshes the result information for each poll_interval seconds.


inference_identifierstrInference identifier'14856eb1-0ad8-49e7-9da3-887acb80fea5'
poll_intervalintTime interval in seconds between polls. Defaults to 0.01.10
timeoutintSeconds amount to wait until timeout. None indicates waiting forever. Defaults to 30.100


A Inference object returned from Inference API


# submit inferences
img_folder = "./images"
inferences = []
for img in os.listdir(img_folder):
input_object = InputSource(
    key="image", # input filename defined by model author
    data=open(os.path.join(img_folder, img), 'rb').read()
with EdgeClient('localhost', 55000) as client:
    inference = client.inferences.perform_inference("<model-id>", "<model-version>", input_object, explain=False, tags=None)

# query results 
with EdgeClient('localhost', 55000) as client:
results = [client.inferences.block_until_complete(inference.identifier) for inferences in inferences]