Course menuAI-901

Exams / AI-901 / Study guide / Vision and image generation apps

Vision and image generation apps: AI-901 study notes and practice questions

What to know about Vision and image generation apps for the AI-901 exam, from the Implement AI solutions by using Microsoft Foundry domain (58% of the exam guide), then 4 free questions to test it. Part of the AI-901 study guide.

Last verified against current Microsoft Learn ·How we write our questions

What to know for the exam

In the course labs, vision work is done with Foundry models rather than with older vision APIs. Two flows matter: interpreting an image and generating one.

Interpreting an image with a multimodal model

  1. Deploy a chat-enabled model that accepts images, from the catalog.
  2. In the playground, use Upload image in the chat pane and ask a question, such as “describe this image” or “how many people are in it?”.
  3. Use Instructions to set the role and format of the answers.
  4. Open the code view, choose Python and key authentication, and read the sample.

In code, the request sends one user message whose content contains a text item and an image item (for example, input_text and input_image with an image URL). The call is responses.create, and the answer is in response.output_text. Because the image is part of the prompt, you can ask follow-up questions, extract details or classify it just by changing the text.

Generating an image

  1. From the Models page, deploy a base model, filtering by Collections “Direct from Azure” and Inference task “Text to image”.
  2. Try prompts in the image playground and use View code for the SDK sample, which uses the OpenAI SDK.
  3. In code, call images.generate(model=<deployment>, prompt="...", n=1, size="1024x1024"). The image comes back as base64 text, so you decode it and write the bytes to a file.

How to choose

Need Use
Describe a photo or answer questions about it Multimodal chat model with an image input
Create artwork from a description Text-to-image model
Read fields from a receipt Content Understanding

Common traps

  • Sending an image to a text-only model. The model must accept images.
  • Treating generated images as URLs. The sample returns base64 data.
  • Using a chat model to generate pictures. Generation needs a text-to-image deployment.
  • Memorizing model names. Lab models change; know the task, not the version.

Try the 4 practice questions

A furniture retailer wants new lifestyle photos for its online catalog. Its designers have written a short text description for each room setting, and they want the images created from those descriptions rather than photographed.

Which Foundry capability should the developer use?

Choose one answer.

  1. A. Azure Vision image tagging, which labels the objects already visible in a photo
  2. B. A text-to-image model deployed in Foundry, called to generate each image
  3. C. Azure Speech text-to-speech, which reads each room description aloud in a voice
  4. D. Azure Content Understanding, which extracts named fields from documents and forms
Show the answer and explanation

Answer: B

  • A. Wrong: Image tagging describes photos that already exist. The retailer needs new images created from text, so tagging does not produce them.
  • B. Right: Correct. A text-to-image model deployed in Foundry generates new images from a text prompt. The developer calls its image generation API with each description. Learn more: What is Microsoft Foundry? (opens in a new tab)
  • C. Wrong: Text-to-speech turns text into audio, not into pictures. It would give the descriptions a voice but produce no images for the catalog.
  • D. Wrong: Content Understanding extracts information from existing content. It does not create new pictures from descriptions.

Explanation

Generating images from text is a text-to-image model task, deployed in Foundry and called through an image generation request. Tagging, speech and extraction tools all work on content that already exists.

Study

A dental clinic's marketing team wants a poster image for its waiting room, generated from a text prompt. The developer's code below requests the image, which comes back as base64 text, and decodes it into bytes.

img = client.images.generate(model=IMAGE_DEPLOYMENT, prompt="Calm blue waiting room poster", n=1, size="1024x1024") image_bytes = base64.b64decode(img.data[0].________)

Which attribute name should replace the blank?

Choose one answer.

  1. A. the url attribute
  2. B. the b64_json attribute
  3. C. the bytes attribute
  4. D. the revised_prompt attribute
Show the answer and explanation

Answer: B

  • A. Wrong: A url field would point to an image to download over HTTP. The decode step needs the encoded text that the response carries, not a link.
  • B. Right: Correct. Each item in the data list carries the base64 text in b64_json, which the code decodes into the image bytes before writing them to a file. Learn more: Lab: Computer vision (opens in a new tab)
  • C. Wrong: bytes is not a field of the response. The response carries base64 text, which must be decoded into bytes, so the attribute named here does not exist.
  • D. Wrong: revised_prompt holds the wording the service rewrote from the original prompt. It does not contain the encoded image.

Explanation

Image generation returns a list in data, and each item carries the image as base64 text in b64_json. The code decodes that text into bytes. The other fields do not hold the encoded image.

Study

A boutique hotel wants a chat assistant that looks at a photo a guest uploads, such as a stain on a carpet, and describes what it sees. Staff also want it to answer questions such as where the damage is. The hotel does not need any new pictures created.

Which approach should the developer use?

Choose one answer.

  1. A. Text-to-image model called with the guest's photo as the prompt, so it generates a matching picture
  2. B. Document Intelligence prebuilt-read model, which extracts the text lines from the photo
  3. C. Send the photo as an image input to a multimodal chat model deployment, with the question as text
  4. D. Azure Vision image tagging, which returns labels for the objects found in the photo
Show the answer and explanation

Answer: C

  • A. Wrong: Text-to-image models generate new pictures from words, which is output the hotel does not want. They do not describe an uploaded photo or answer questions about it.
  • B. Wrong: The read model extracts text from documents. A photo of a stain has no words to read, so it cannot say where the damage is.
  • C. Right: Correct. Multimodal chat models accept images along with text, so the assistant can describe the photo and answer questions about it. The developer sends the image in the request with the question. Learn more: Lab: Computer vision (opens in a new tab)
  • D. Wrong: Image tagging returns labels such as carpet or floor for an existing photo. It cannot hold a conversation or answer a guest's follow-up question about where the damage is.

Explanation

Describing and answering questions about a photo is a multimodal model task, where the image goes in as an input alongside the question. Image generation creates new pictures, and tagging and document text extraction return labels or text without answering questions.

Study

A school's facilities team has a photo of the assembly hall taken during a whole-school event. The team wants to know how many faces are visible in the photo, and it does not need to identify anyone.

Which Foundry Tool capability fits this need?

Choose one answer.

  1. A. Face identification in Azure Vision, which matches each face to a list of known students
  2. B. Face detection in Azure Vision, which finds faces in an image and returns their positions
  3. C. Image captioning in Azure Vision, which writes one sentence describing the whole scene
  4. D. Azure Translator, which translates text labels found in the photo into another language
Show the answer and explanation

Answer: B

  • A. Wrong: Face identification compares faces with a stored group of known people, which goes beyond what the team needs. The team only wants a count, and identifying students would add privacy concerns for no benefit.
  • B. Right: Correct. Face detection locates each face in an image and returns its position, which is enough to count visible faces. It does not need to identify anyone. Learn more: What is Azure Vision? (opens in a new tab)
  • C. Wrong: A caption gives a short description such as a crowded hall at an event. It does not return the position of each face, so it cannot give a reliable count.
  • D. Wrong: Translator works on text in different languages. It does not detect faces, so it cannot say how many faces appear in the photo.

Explanation

Face detection in Azure Vision returns the location of each face in an image, which is enough to count them. Face identification goes further than needed by matching faces to people, and captioning only describes the scene. Document layout extraction reads forms, not photos of people.

Study

Want more on Vision and image generation apps? The 5 full-length practice sets have 20 more Vision and image generation apps questions, 225 in all, none of them in the free exam. One payment of $9.99 $6.99, no subscription. Get the practice sets

Study Vision and image generation apps

More Implement AI solutions by using Microsoft Foundry topics

Every exam starts with free questions. No account needed.