ckandemir / blip-image-captioning-large-inference

huggingface.co
Total runs: 14
24-hour runs: 0
7-day runs: 0
30-day runs: -32
Model's Last Updated: October 18 2023
image-to-text

Introduction of blip-image-captioning-large-inference

Model Details of blip-image-captioning-large-inference

Fork of Salesforce/blip-image-captioning-large for a image-captioning task on 🤗Inference endpoint.

This repository implements a custom task for image-captioning for 🤗 Inference Endpoints. The code for the customized pipeline is in the pipeline.py . To use deploy this model a an Inference Endpoint you have to select Custom as task to use the handler.py file. -> double check if it is selected

expected Request payload
{
  "image": "/9j/4AAQSkZJRgA.....", #encoded image
  "text": "a photography of a"
}

below is an example on how to run a request using Python and requests .

Run Request
  1. Use any online image.
!wget https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg

2.run request

import json
from typing import List
import requests as r
import base64

with open("/content/demo.jpg", "rb") as image_file:
    encoded_string = base64.b64encode(image_file.read()).decode()

ENDPOINT_URL = ""
HF_TOKEN = ""

def query(payload):
    response = requests.post(API_URL, headers=headers, json=payload)
    return response.json()


output = query({
    "inputs": {
        "images": [encoded_string],  # using the base64 encoded string
        "texts": ["a photography of"]  # Optional, based on your current class logic
    }
})
print(output)

Example parameters depending on the decoding strategy:

  1. Beam search
        "parameters": {
                   "num_beams":5,
                   "max_length":20
        }
  1. Nucleus sampling
        "parameters": {
                   "num_beams":1,
                   "max_length":20,
                   "do_sample": True,
                   "top_k":50,
                   "top_p":0.95
        }
  1. Contrastive search
        "parameters": {
                   "penalty_alpha":0.6,
                   "top_k":4
                   "max_length":512
        }

See generate() doc for additional detail

expected output

{'captions': ['a photography of a woman and her dog on the beach']}

Runs of ckandemir blip-image-captioning-large-inference on huggingface.co

14
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
-32
30-day runs

More Information About blip-image-captioning-large-inference huggingface.co Model

More blip-image-captioning-large-inference license Visit here:

https://choosealicense.com/licenses/bsd-3-clause

blip-image-captioning-large-inference huggingface.co

blip-image-captioning-large-inference huggingface.co is an AI model on huggingface.co that provides blip-image-captioning-large-inference's model effect (), which can be used instantly with this ckandemir blip-image-captioning-large-inference model. huggingface.co supports a free trial of the blip-image-captioning-large-inference model, and also provides paid use of the blip-image-captioning-large-inference. Support call blip-image-captioning-large-inference model through api, including Node.js, Python, http.

blip-image-captioning-large-inference huggingface.co Url

https://huggingface.co/ckandemir/blip-image-captioning-large-inference

ckandemir blip-image-captioning-large-inference online free

blip-image-captioning-large-inference huggingface.co is an online trial and call api platform, which integrates blip-image-captioning-large-inference's modeling effects, including api services, and provides a free online trial of blip-image-captioning-large-inference, you can try blip-image-captioning-large-inference online for free by clicking the link below.

ckandemir blip-image-captioning-large-inference online free url in huggingface.co:

https://huggingface.co/ckandemir/blip-image-captioning-large-inference

blip-image-captioning-large-inference install

blip-image-captioning-large-inference is an open source model from GitHub that offers a free installation service, and any user can find blip-image-captioning-large-inference on GitHub to install. At the same time, huggingface.co provides the effect of blip-image-captioning-large-inference install, users can directly use blip-image-captioning-large-inference installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

blip-image-captioning-large-inference install url in huggingface.co:

https://huggingface.co/ckandemir/blip-image-captioning-large-inference

Url of blip-image-captioning-large-inference

blip-image-captioning-large-inference huggingface.co Url

Provider of blip-image-captioning-large-inference huggingface.co

ckandemir
ORGANIZATIONS

Other API from ckandemir

huggingface.co

Total runs: 66
Run Growth: 54
Growth Rate: 81.82%
Updated:August 20 2024
huggingface.co

Total runs: 7
Run Growth: 5
Growth Rate: 71.43%
Updated:September 07 2023
huggingface.co

Total runs: 2
Run Growth: 1
Growth Rate: 50.00%
Updated:September 05 2023
huggingface.co

Total runs: 0
Run Growth: 0
Growth Rate: 0.00%
Updated:August 11 2023