How to use the azure-cognitiveservices-vision-customvision.azure.cognitiveservices.vision.customvision.prediction.models function in azure-cognitiveservices-vision-customvision

To help you get started, we’ve selected a few azure-cognitiveservices-vision-customvision examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-python / azure-cognitiveservices-vision-customvision / azure / cognitiveservices / vision / customvision / prediction / custom_vision_prediction_client.py View on Github external
header_parameters['Content-Type'] = 'multipart/form-data'
        if custom_headers:
            header_parameters.update(custom_headers)
        header_parameters['Prediction-Key'] = self._serialize.header("self.config.api_key", self.config.api_key, 'str')

        # Construct form data
        form_data_content = {
            'imageData': image_data,
        }

        # Construct and send request
        request = self._client.post(url, query_parameters, header_parameters, form_content=form_data_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200]:
            raise models.CustomVisionErrorException(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ImagePrediction', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    detect_image_with_no_store.metadata = {'url': '/{projectId}/detect/iterations/{publishedName}/image/nostore'}

azure-cognitiveservices-vision-customvision

Microsoft Azure Custom Vision Client Library for Python

MIT
Latest version published 1 month ago

Package Health Score

84 / 100
Full package analysis

Popular azure-cognitiveservices-vision-customvision functions

Similar packages