Skip to content

Commit 58558ec

Browse files
Merge pull request #253004 from dargilco/dargilco/9-27/fix-python-image-buffer-input
Python Image Analysis: Fix missing "Image file" section, and wrong title for "Image buffer" section.
2 parents d0bacba + 6c4fa85 commit 58558ec

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

articles/ai-services/computer-vision/includes/how-to-guides/analyze-image-40-python.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ In your script, create a new [VisionSource](/python/api/azure-ai-vision/azure.ai
4242

4343
### Image file
4444

45+
In your script, create a new [VisionSource](/python/api/azure-ai-vision/azure.ai.vision.visionsource) object from the local image file you want to analyze.
46+
47+
```python
48+
vision_source = sdk.VisionSource(filename="sample.jpg")
49+
```
50+
51+
### Image buffer
52+
4553
In your script, first create an **image_source_buffer**. Get its **image_writer** and call the **write** method to copy the image data into the writer. Then create a new [vision_source](/python/api/azure-ai-vision/azure.ai.vision.visionsource) object from your **image_source_buffer**. In the following code example, `image_buffer` is a variable of type `bytes` containing the image data.
4654

4755
```python

0 commit comments

Comments
 (0)