Image to prompt with BLIP and CLIP
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

7 lines
283 B

import sys
from PIL import Image
from clip_interrogator import Config, Interrogator
# import torch
image = Image.open('../pushd-gpt/output/resized.jpg').convert('RGB')
ci = Interrogator(Config(clip_model_name="ViT-H-14/laion2b_s32b_b79k", device='mps'))
print(ci.interrogate(image))