Skip to content

Commit c38bcb6

Browse files
author
Jim Bennett
committed
Update azurecustomvision_prediction.py
1 parent dbb8d6b commit c38bcb6

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

azurecustomvision_prediction.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,21 +190,15 @@ def _process_image_url(self, route: str, project_id: str, published_name: str, u
190190

191191
body = json.dumps({"url": url})
192192
result = _run_request_with_retry(endpoint, body, headers)
193-
result_text = result.text
194-
195-
return ImagePrediction(result_text)
193+
return ImagePrediction(result.text)
196194

197195
def _process_image(self, route: str, project_id: str, published_name: str, image_data: bytearray, store: bool, application):
198196
endpoint = self._format_endpoint(route, project_id, published_name, store, application)
199197

200198
headers = {"Content-Type": "application/octet-stream", "Prediction-Key": self._prediction_key}
201199

202200
result = _run_request_with_retry(endpoint, image_data, headers)
203-
result_text = result.text
204-
205-
print(result_text)
206-
207-
return ImagePrediction(result_text)
201+
return ImagePrediction(result.text)
208202

209203
def _classify_image_url(self, project_id: str, published_name: str, url: str, store: bool, application):
210204
return self._process_image_url(self._classify_image_url_route, project_id, published_name, url, store, application)

0 commit comments

Comments
 (0)