from azure.cognitiveservices.vision.customvision.prediction import CustomVisionPredictionClient
from msrest.authentication import CognitiveServicesCredentials
endpoint = 'https://####customvision-prediction.cognitiveservices.azure.com'
project_id = '####8db4-66e8-40b3-aa4a-fe3cbb30da35'
prediction_key = '####1670040b44499a8178ffe59be76e'
project_name = '####Test'
credential = CognitiveServicesCredentials(prediction_key)
predict = CustomVisionPredictionClient(endpoint, credential)
with open("./TallowTest1.jpg", mode="rb") as image_data:
tallowresult = predict.detect_image(project_id, project_name, image_data)
I've now created the CustomVision resources twice in Azure, I think I have it right now. I selected both a training and a prediction service. Then went to customvision.ai and created a project. I uploaded photos and trained the model. Now, I'm trying the most simplistic Python script possible and still getting errors. The most recent one is this:
...
raise models.CustomVisionErrorException(self._deserialize, response)
azure.cognitiveservices.vision.customvision.prediction.models._models_py3.CustomVisionErrorException: Operation returned an invalid status code 'PermissionDenied'
Note, that I'm perfectly willing to share keys at this point. This is only a test and I can't get it working. I'll share every key if someone will show me how to get this working. I feel like I've tried every combination of keys, endpoints, project ids. And I get different error messages in different cases but nothing is working.