
    modified_captions.append(dataset[idx]["output"])
    edited_images.append(edited_image) To measure the directional similarity, we first load CLIP’s image and text encoders:   Copied from transformers import (
    CLIPTokenizer,
    CLIPTextModelWithProjection,
    CLIPVisionModelWithProjection,
    CLIPImageProcessor,
)

clip_id = "openai/clip-vit-large-patch14"
tokenizer = CLIPTokenizer.from_pretrained(clip_id)
text_encoder = CLIPTextMode