QuestionQ139

VerifiedImplement computer vision solutions

You are developing a method that uses the Azure Vision in Foundry Tools client library. The method will perform optical character recognition (OCR) on images. The method contains the following code.

Question Image

During testing, you find that the call to the get_read_result method happens before the read operation has completed.

You need to stop the get_read_result method from continuing until the read operation is complete.

Which two actions should you take? Each correct answer provides part of the solution.

NOTE: Each correct selection is worth one point.

Choose two
Explanation

Azure Read OCR is asynchronous. Poll get_read_result(operation_id) in a loop, pausing between requests, and inspect read_result.status until it is no longer notStarted or running before processing the result. The Operation-Location value supplies the operation ID rather than reporting completion status.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!