Menu

Suprisingly two sleeping cats taught me Vision Language models
πŸ“°

Suprisingly two sleeping cats taught me Vision Language models

DEV Community: computervisionΒ·Irakoze DeborahΒ·about 12 hours ago
#I3hWKt2W
#devtocomputervision#technology#devto#dev#enter
Reading 0:00
15s threshold

I wanted to understand vision language models (VLMs), the AI that looks at a photo and answers questions about it. So I started with a tiny grid of numbers and ended up quizzing an AI about two sleeping cats.

Everything below runs free in Google Colab.

An image is just numbers

import numpy as np

tiny = np . zeros (( 8 , 8 )) tiny [:, 4 :] = 9 # left dark, right bright print ( tiny )

Enter fullscreen mode

Exit fullscreen mode

Output:

[[0. 0. 0. 0. 9. 9. 9. 9.] [0. 0. 0. 0. 9. 9. 9. 9.] [0. 0. 0. 0. 9. 9. 9. 9.] [0. 0. 0. 0. 9. 9. 9. 9.] [0. 0. 0. 0. 9. 9. 9. 9.] [0. 0. 0. 0. 9. 9. 9. 9.] [0. 0. 0. 0. 9. 9. 9. 9.] [0. 0. 0. 0. 9. 9. 9. 9.]]

Enter fullscreen mode

Exit fullscreen mode

Every row is 0 0 0 0 9 9 9 9 . There's an edge, but the computer needs a way to find it.

A filter finds the edge

kernel = np . array ([ - 1 , 0 , 1 ]) # right pixel minus left pixel out = np . array ([[ np .…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.