Retrieve BlipForImageTextRetrieval image features
Hey!I am trying to get the image features/embeddings fromBlipForImageTextRetrieval.According to the docs:image_embeds(torch.FloatTensorof shape(batch_size, output_dim)optionalreturned when model is initialized withwith_projection=True) — The image embeddings obtained by applying the projection layer to the pooler_outputHow can i set thewith_projectionto True, I can not find any information anywhere for this?Is there any other way to extract the features?How would i go on and extract the text_features (for a future use case)?Thank you !Edit: This is my current workarounddef get_vision_features(img_path, model, processor):
    vision_model = model.vision_model
    
    img = Image.open(img_path)
    processed_images = processor(img, return_tensors="pt")

    vision_embeddings = vision_model(pixel_values=processed_images.pixel_values, return_dict=True).pooler_output

    vision_features = model.vision_proj(vision_embeddings)