OpenAI GPT-4o vision capabilities are good
I hand-drew the above image, then fed it to openAI's new GPT-4o model via its API with a few lines of Python code. This is what the model replied,
from openai import OpenAI
import os
import cv2
import base64
import time
MODEL="gpt-4o"
client = OpenAI(api_key='YOUR_API_KEY_HERE')
# Path to your local image
image_path = 'geom.png'
# Read the image file in binary mode and encode it to base64
with open(image_path, 'rb') as image_file:
base64_image = base64.b64encode(image_file.read()).decode('utf-8')
response = client.chat.completions.create(
model=MODEL,
messages=[
{"role": "system", "content": "You are a helpful assistant that responds in Markdown. Help me with my math homework!"},
{"role": "user", "content": [
{"type": "text", "text": "What is the value of x in this image?"},
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{base64_image}"}
}
]}
],
temperature=0.0,
)
print(response.choices[0].message.content)
In a parallelogram, opposite angles are equal, and adjacent angles are supplementary (i.e., they add up to 180 degrees).Given:\[\angle A = 3x + 26^\circ\]\[\angle D = 4x + 14^\circ\]Since \(\angle A\) and \(\angle D\) are adjacent angles in the parallelogram, they must add up to 180 degrees:\[(3x + 26^\circ) + (4x + 14^\circ) = 180^\circ\]Combine like terms:\[3x + 4x + 26^\circ + 14^\circ = 180^\circ\]\[7x + 40^\circ = 180^\circ\]Subtract 40 degrees from both sides:\[7x = 140^\circ\]Divide both sides by 7:\[x = 20^\circ\] So, \(x\) is \(20\) degrees.
Pretty impressive!