Computer vision and image generation

AI-901 Azure AI FundamentalsBuilding AI solutions with Microsoft FoundryAbout 20 minutesBy Cloud Hands On

Send images to a multimodal model, generate new images from text, and build a small app with vision capabilities.

In this lesson you'll learn

1. Images in prompts

New to computer vision? Start here

Computer vision lets software understand images: what's in them, where objects are, and what text they contain. Modern multimodal models can look at an image and answer questions about it in plain language.

With a multimodal model, a prompt can contain text and an image (as a URL or base64 data). Ask questions such as "What's damaged in this photo?" or "Turn this whiteboard sketch into a to-do list."

reply = client.responses.create(
    model="my-multimodal-deployment",
    input=[{"role": "user", "content": [
        {"type": "input_text", "text": "Describe any damage to this car."},
        {"type": "input_image", "image_url": "https://example.com/car.jpg"}]}])
print(reply.output_text)

2. Generating images

Image generation models create new images from a text description, and some can edit an existing image from instructions. Give clear prompts that describe the subject, style, setting and composition. Guardrails block harmful requests and generated content may carry provenance credentials to show it was AI-generated.

3. Ready-made vision features

FeatureReturns
Captions and dense captionsA sentence describing the image, or several regions
TagsKeywords for things in the image
Object detectionObjects with bounding boxes
OCR (Read)Printed and handwritten text, with positions
Face detectionFace locations and attributes (identification features need approval)

Example

An online furniture shop lets customers upload a photo of their living room. A multimodal model describes the style and colours, and an image generation model shows a sofa from the catalogue in a matching setting. Every generated image is labelled as AI-generated.

Exam traps to remember

  • Interpreting an image (describing, answering questions) is different from generating a new one.
  • OCR extracts text. It doesn't explain what a picture shows.
  • Facial recognition that identifies people is a limited-access feature, for responsible AI reasons.

Test yourself: 3 check questions and exam-style practice questions on this topic are in the AI-901 Azure AI Fundamentals app.

Practise in the app

Keep going