SK4P3 / blip-image-captioning-docker

BLIP Image Captioning with API
MIT License
3 stars 3 forks source link
blip docker flask image-captioning python pytorch threading

BLIP Image Captioning inside a Docker Container with simple API

Features

API Endpoints

Setup/Installation

Example

POST /captionImage

Request:

{
    "imgurl": ["https://images.pexels.com/photos/45201/kitty-cat-kitten-pet-45201.jpeg?auto=compress&cs=tinysrgb&w=1600"]
}

Response:

{
    "id": "4fbc68319cd6491daf7451139f58b6c7",
    "msg": "Job Started!"
}

POST /captionImageBlocking

Request:

{
    "imgurl": ["https://images.pexels.com/photos/45201/kitty-cat-kitten-pet-45201.jpeg?auto=compress&cs=tinysrgb&w=1600", "https://images.pexels.com/photos/45201/kitty-cat-kitten-pet-45201.jpeg?auto=compress&cs=tinysrgb&w=1600"]
}

Response:

{
    "id": "93496917b71b44d49138cab7e4c5451d",
    "msg": "Job finished!",
    "result": [
        "a black and white cat sitting in the snow",
        "a black and white cat sitting in the snow",
        "a black and white cat sitting in the snow",
        "a black and white cat sitting in the snow",
        "a black and white cat sitting in the snow",
        "a black and white cat sitting in the snow",
        "a black and white cat sitting in the snow",
        "a black and white cat sitting in the snow",
        "a black and white cat sitting in the snow",
        "a black and white cat sitting in the snow"
    ]
}

GET /captionImage

Response:

[
    {
        "id": "4fbc68319cd6491daf7451139f58b6c7",
        "result": [
            "a white kitten with blue eyes sitting on a leopard print blanket"
        ]
    }
]