Skip to content

simonaco/serverless-cognitive-services

Repository files navigation

Collection of Azure Functions wrappers for Azure Cognitive Services API

Computer Vision API

The Computer Vision API provides state-of-the-art algorithms to process images and return information. For example, it can be used to determine if an image contains mature content, or it can be used to find all the faces in an image. It also has other features like estimating dominant and accent colors, categorizing the content of images, and describing an image with complete English sentences. Additionally, it can also intelligently generate images thumbnails for displaying large images effectively.

To run functions in this project you need a Computer Vision instance.

You can create one either using the Azure Portal or using the Azure CLI.

az cognitiveservices account create -n serverless-cvs -g serverlesscognitiveservices --kind "ComputerVision" --sku F0 -l WestUS2 --yes

Rename local.settings.sample.json to local.settings.json and replace API_URL and API_KEY with your settings.

You can retrieve the API_KEY value either from the Azure Portal, on the Keys tab or using the Azure CLI:

az cognitiveservices account keys list -n serverless-cvs -g serverlesscognitiveservices

Same for the API_ENDPOINT, you can get it from the Overview page in the Azure Portal or using the Azure CLI:

az cognitiveservices account show -n serverless-cvs -g serverlesscognitiveservices

Install npm dependencies by running npm i. To run the project in VS Code click on the debug icon and then click start Debugging. This will start the Azure Functions runtime and generate URLs of this form http://localhost:7071/api/analyze-image

Test API

Deployed application at:

  1. Analyze Image

  2. Describe Image

  3. Face Detect

  4. OCR

  5. Tag Image

More resources

  1. API reference documentation Computer Vision API

  2. Azure CLI commands for Azure Cognitive Services

Releases

No releases published

Packages

No packages published