MSDN Documentation

Cognitive Services Vision API Tutorials

Unlock the power of artificial intelligence to understand and process images.

Explore Tutorials

Welcome to the Cognitive Services Vision API Tutorials

The Microsoft Azure Cognitive Services Vision API allows you to build intelligent applications that can see and interpret the world. This collection of tutorials will guide you through various features, from basic image analysis to advanced custom vision solutions.

Featured Tutorials

  • Getting Started with Image Analysis

    Learn how to use the Vision API to detect objects, describe scenes, identify celebrities, and analyze adult content.

    Learn More →
  • Optical Character Recognition (OCR)

    Extract text from images and documents to make your content searchable and editable.

    Learn More →
  • Face Detection and Recognition

    Understand how to detect faces, analyze attributes, and group similar faces using the Face API.

    Learn More →
  • Custom Vision Service: Image Classification

    Build your own custom image classification models tailored to your specific needs.

    Learn More →
  • Custom Vision Service: Object Detection

    Train models to detect and locate specific objects within images.

    Learn More →
  • Video Indexer: Extract Insights from Videos

    Discover how to analyze video content for insights like spoken words, faces, sentiments, and more.

    Learn More →

Key Concepts

The Vision API offers a range of powerful capabilities:

  • Image Analysis: Provides rich metadata about the content of an image, including descriptions, tags, objects, and brands.
  • OCR: Enables you to read text from images and documents.
  • Face API: Detects and analyzes human faces, including attributes like age, gender, emotion, and identification.
  • Custom Vision: Allows you to build and deploy custom machine learning models for image classification and object detection with your own data.
  • Video Indexer: A comprehensive video analytics service that extracts insights from video content.

Prerequisites

To follow these tutorials, you'll generally need:

  • An Azure account (free trial available).
  • A Vision API resource created in Azure.
  • Appropriate SDKs or REST API tools installed on your development machine (e.g., Python, C#, Node.js).

Code Examples

Many tutorials include code snippets to help you implement these features quickly. Here's a basic example of calling the Image Analysis API using Python:


import requests
import os

# Replace with your Vision API subscription key and endpoint
subscription_key = os.environ.get('VISION_KEY')
endpoint = os.environ.get('VISION_ENDPOINT')

analyze_url = endpoint + "vision/v3.2/analyze"

image_url = "https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/bigdata-1480x987.jpg"

headers = {
    'Ocp-Apim-Subscription-Key': subscription_key,
    'Content-Type': 'application/json'
}

params = {
    'visualFeatures': 'Categories,Description,Tags,Objects',
    'language': 'en'
}

data = {
    'url': image_url
}

response = requests.post(analyze_url, headers=headers, params=params, json=data)
response.raise_for_status() # Raise an exception for bad status codes

analysis = response.json()

print("Description:", analysis['description']['captions'][0]['text'])
print("Tags:", [tag['name'] for tag in analysis['tags']])