Computer Vision and Image Generation in Foundry · Topic 1 of 2
Visual Input and Vision Applications
AI-901 vision apps: sending an image with image_url to a multimodal model, URL or base64 input, the detail setting, limits, and video as frames.
- 5 min
- Images go in a message as an
image_urlpart, as a web address or a base64 data URL. detailcan beauto,loworhigh, trading speed and cost against fine detail.- A multimodal model reads text in photos and answers questions, but it is not a medical tool and does not return exact boxes.
What it is
A multimodal model accepts more than text. When it accepts images, you can show it a picture and ask a question in plain language: describe this photo, read the text on this label, compare these two diagrams. The model answers in text.
A vision application wraps that capability in a small program, for example one that lets users upload a product photo and returns a written description.
How it works
Sending an image
The message content is a list, with a text part for the instruction and an image_url part for the picture.
messages = [
{"role": "system", "content": "You describe product photos for a catalogue."},
{"role": "user", "content": [
{"type": "text", "text": "Describe this product in two sentences."},
{"type": "image_url", "image_url": {"url": "https://example.com/photos/lamp.jpg", "detail": "auto"}},
]},
]
reply = openai.chat.completions.create(
model="your-multimodal-deployment",
messages=messages,
max_tokens=300,
)
print(reply.choices[0].message.content)
The url can be:
- A web address the service can reach, such as a link to a stored image.
- A base64 data URL for a local file, written as
data:image/jpeg;base64,<encoded data>. The app reads the file and encodes it first.
The detail setting
The optional detail value controls how closely the model looks at the image.
| Value | Effect |
|---|---|
auto | The default. The model chooses between low and high based on the image size |
low | Processes a lower resolution version. Faster and uses fewer tokens. Good when fine detail does not matter |
high | Looks at the image in more detail. Slower and uses more tokens. Good for small text and fine detail |
Images use tokens, so larger or higher detail images cost more and use more of the context window.
What the model does well
- Describing and summarising what is in a picture.
- Answering questions about an image.
- Reading text that appears in a photo, such as a sign or a slide.
- Comparing several images that you send in one message.
Limitations to plan for
| Limit | What it means |
|---|---|
| Not a medical tool | A model is not approved to diagnose from medical scans |
| Small, blurred or rotated text | It can misread poor quality text |
| Not an object detector | It does not give pixel exact bounding boxes for objects |
| Image only | It accepts images, and a video file cannot be passed through image_url |
| No learning from images | It does not keep your images to retrain itself |
For video, a chat call cannot take the file directly. A practical approach is to sample several frames from the clip and send them as separate image parts, together with a transcript of the audio as text.
Vision applications beyond the multimodal model
For tasks such as OCR, object detection or tagging with structured output, a dedicated vision service may be the better choice, because it returns exact coordinates and a fixed format. A multimodal model suits open ended description and questions. Many applications use both.
Handling errors and cost
A 429 response means the rate limit was reached, so the app waits and retries with backoff. Reducing detail to low and resizing very large images before sending them lowers cost. Dropping detail and resending at once does not fix a rate limit error.
A worked scenario
An online marketplace lets sellers upload a photo and receive a draft listing. The app encodes the photo as a base64 data URL, sends it with the instruction "Write a title and a two sentence description", and sets detail to auto. The model's reply becomes the draft. For photos of price labels with small print, the team switches to high detail. When the team asks for the exact position of each item in the photo, they find the multimodal model does not return boxes, so they add a vision service for object detection. Product videos are handled by sending a few sampled frames and the narration transcript.
What to remember for the exam
- Images go in a message as an
image_urlpart, as a web address or a base64 data URL. detailcan beauto,loworhigh, trading speed and cost against fine detail.- A multimodal model reads text in photos and answers questions, but it is not a medical tool and does not return exact boxes.
- Video is sent as sampled frames plus a transcript, not as a file in
image_url. - A multimodal model returns text. An image generation model creates pictures.
Sending an image to a text only model fails or is ignored. The deployment must be a model that accepts images.
How the exam asks about this
- "A user uploads a product photo and gets a written description. Which design?" Send the photo and an instruction to a multimodal chat model.
- "Which two limitations should users expect?" It is not suited to medical scan diagnosis, and small, blurred or rotated text can be misread.
- "Summarise a short video through chat completions." Send sampled frames as image parts and the audio transcript as text.
- "Which setting trades detail for speed and token use?" The detail parameter.
Common mistakes
Passing a video as image_url. It accepts images, not video files.
Expecting bounding boxes. Use a dedicated vision service when you need coordinates.
Using high detail everywhere. It costs more and is only needed for fine print.
Using a speech to text model for a photo. That model handles audio.
Check yourself
How is a local image file sent to a multimodal model?
Encode it as a base64 data URL and pass it in an image_url content part.
What does the detail setting control?
How closely the model examines the image, trading speed and token use against fine detail.
How can a short video be summarised through chat completions?
Send several sampled frames as image parts and the audio transcript as text.
Topic 1 of 2 in Computer Vision and Image Generation in Foundry
Test yourself on Computer Vision and Image Generation in Foundry
The full Microsoft AI-901 question bank has 511 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Microsoft. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.