- The easiest way to build an image dataset
- We make one reference vector by normalizing the vector of the reference image, text, and compare the cosine similarity, where the vector embedding uses the ViT-B-32 model.
- Use all images from query's Google Image search results.
- Too many image search results may cause errors.
![]() |
![]() |
if __name__ == '__main__':
# create Classfication Class based on ViT-32
cf = Classfication(
['https://{The program automatically crawls only images that are similar to the input image.}'],
['frog']
)
# create Firefox client
client = Client(path='geckodriver path')
# get images from google
images = client.get_images(query='pepe') # Query are required
# classify all images
result = cf.classify_all(images)
# save images
for idx, img in enumerate(result):
cf.save_base64_image(img, f'./{idx}.png')