IBM
Image Agent
Code
cookbook/models/ibm/watsonx/image_agent_bytes.py
Usage
1
Create a virtual environment
Open the Terminal
and create a python virtual environment.
2
Set your API key
3
Install libraries
4
Add sample image
Place a sample image named “sample.jpg” in the same directory as the script.
5
Run Agent
This example shows how to use IBM WatsonX with vision capabilities. It loads an image from a file and passes it to the model along with a prompt. The model can then analyze the image and provide relevant information.
Note: This example uses a vision-capable model (meta-llama/llama-3-2-11b-vision-instruct
) and requires a sample image file.