MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.26k stars 21.43k forks source link

the example on this page doesn't work #56890

Closed kobiwan closed 4 years ago

kobiwan commented 4 years ago

[Enter feedback here]

below import block doesn't work, fails at "from azure.cognitiveservices.vision.computervision.models import TextOperationStatusCodes" and "from azure.cognitiveservices.vision.computervision.models import TextRecognitionMode"

from azure.cognitiveservices.vision.computervision import ComputerVisionClient from azure.cognitiveservices.vision.computervision.models import TextOperationStatusCodes from azure.cognitiveservices.vision.computervision.models import TextRecognitionMode from azure.cognitiveservices.vision.computervision.models import VisualFeatureTypes from msrest.authentication import CognitiveServicesCredentials

from array import array import os from PIL import Image import sys import time

additionally, this code block doesn't work. Looks like status codes are case sensitive.

while True: get_handw_text_results = computervision_client.get_read_result(operation_id) if get_handw_text_results.status not in ['NotStarted', 'Running']: break time.sleep(1)


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

YutongTie-MSFT commented 4 years ago

@kobiwan Thanks for the feedback! I have assigned the issue to the content author to investigate further and update the document as appropriate.

RohitMungi-MSFT commented 4 years ago

@kobiwan Did you install the pip package before running the import statement?

pip install azure-cognitiveservices-vision-computervision

Works fine for me image

YutongTie-MSFT commented 4 years ago

@kobiwan We will now proceed to close this thread. If there are further questions regarding this matter, please respond here and @YutongTie-MSFT and we will gladly continue the discussion.