The GPT class is designed for text-to-text interactions, utilizing models from the Generative Pre-trained Transformer series. These models are adept at understanding and generating text based on the input provided.
The GPTVision class extends the capabilities of GPT to include handling image inputs, making it suitable for image-to-text tasks.
This class is part of the multimodal models that can process both text and images.
GPT-4o and GPT-4v are the leading Vision Language models and are capable of understanding relatively fine details in images.
Although when scaling to datasets of millions of images, these models can become prohibitively expensive.Generally, GPT-4o is the best model to use for image-to-text tasks, and is cheaper than GPT-4v.
from overeasy import *from PIL import Imageworkflow = Workflow([ BinaryChoiceAgent("Do the Celtics have possession of the ball?", model=GPTVision(model="gpt-4o"))])image=Image.open("bball.png")result, graph = workflow.execute(image)print(result[0].data.class_names)
Many GPT Visual models have relatively strict guard rails around inputs/photos of people so your requests may get screened out if they are related to these topics.
These models also generally struggle with spatial reasoning(i.e. is object A in front of object B?).For more details check the OpenAI docs