Skip to content

Latest commit

 

History

History

blip

BLIP

Intro

This repo containerizes BLIP into a serving container using fastapi.

The model license can be found here.

Features:

  • Image captioning
  • Open-ended visual question answering
  • Multimodal / unimodal feature extraction
  • Image-text matching

Setup

  1. Clone repo if you haven't. Navigate to the blip folder.

  2. Build container. Don't forget to change the project_id to yours.

    docker build . -t gcr.io/{project_id}/blip:latest
  3. Run container. No GPU is needed for this model.

    docker run --rm -p 80:8080 -e AIP_HEALTH_ROUTE=/health -e AIP_HTTP_PORT=8080 -e AIP_PREDICT_ROUTE=/predict gcr.io/{project_id}/blip:latest
  4. Make predictions

    python test_container.py

Deploy in Vertex AI.

You'll need to enable Vertex AI and have authenticated with a service account that has the Vertex AI admin or editor role.

  1. Push the image

    gcloud auth configure-docker
    docker build . -t gcr.io/{project_id}/blip:latest
    docker push gcr.io/{project_id}/blip:latest
  2. Deploy in Vertex AI Endpoints.

    python ../gcp_deploy.py --image-uri gcr.io/<project_id>/blip:latest --accelerator-count 0 --model-name blip --endpoint-name blip-endpoint --endpoint-deployed-name blip-deployed-name
  3. Test the endpoint.

    python generate_request_vertex.py