unography / blip-large-long-cap

huggingface.co
Total runs: 11.3K
24-hour runs: -439
7-day runs: -1.5K
30-day runs: 3.5K
Model's Last Updated: April 16 2024
image-to-text

Introduction of blip-large-long-cap

Model Details of blip-large-long-cap

LongCap: Finetuned BLIP for generating long captions of images, suitable for prompts for text-to-image generation and captioning text-to-image datasets

Usage

You can use this model for conditional and un-conditional image captioning

Using the Pytorch model
Running the model on CPU
Click to expand
import requests
from PIL import Image
from transformers import BlipProcessor, BlipForConditionalGeneration

processor = BlipProcessor.from_pretrained("unography/blip-large-long-cap")
model = BlipForConditionalGeneration.from_pretrained("unography/blip-large-long-cap")

img_url = 'https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg' 
raw_image = Image.open(requests.get(img_url, stream=True).raw).convert('RGB')

inputs = processor(raw_image, return_tensors="pt")
pixel_values = inputs.pixel_values
out = model.generate(pixel_values=pixel_values, max_length=250)
print(processor.decode(out[0], skip_special_tokens=True))
>>> a woman sitting on the beach, wearing a checkered shirt and a dog collar. the woman is interacting with the dog, which is positioned towards the left side of the image. the setting is a beachfront with a calm sea and a golden hue.
Running the model on GPU
In full precision
Click to expand
import requests
from PIL import Image
from transformers import BlipProcessor, BlipForConditionalGeneration

processor = BlipProcessor.from_pretrained("unography/blip-large-long-cap")
model = BlipForConditionalGeneration.from_pretrained("unography/blip-large-long-cap").to("cuda")

img_url = 'https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg' 
raw_image = Image.open(requests.get(img_url, stream=True).raw).convert('RGB')

inputs = processor(raw_image, return_tensors="pt").to("cuda")
pixel_values = inputs.pixel_values
out = model.generate(pixel_values=pixel_values, max_length=250)
print(processor.decode(out[0], skip_special_tokens=True))
>>> a woman sitting on the beach, wearing a checkered shirt and a dog collar. the woman is interacting with the dog, which is positioned towards the left side of the image. the setting is a beachfront with a calm sea and a golden hue.
In half precision ( float16 )
Click to expand
import torch
import requests
from PIL import Image
from transformers import BlipProcessor, BlipForConditionalGeneration

processor = BlipProcessor.from_pretrained("unography/blip-large-long-cap")
model = BlipForConditionalGeneration.from_pretrained("unography/blip-large-long-cap", torch_dtype=torch.float16).to("cuda")

img_url = 'https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg' 
raw_image = Image.open(requests.get(img_url, stream=True).raw).convert('RGB')

inputs = processor(raw_image, return_tensors="pt").to("cuda", torch.float16)
pixel_values = inputs.pixel_values
out = model.generate(pixel_values=pixel_values, max_length=250)
print(processor.decode(out[0], skip_special_tokens=True))
>>> a woman sitting on the beach, wearing a checkered shirt and a dog collar. the woman is interacting with the dog, which is positioned towards the left side of the image. the setting is a beachfront with a calm sea and a golden hue.

Runs of unography blip-large-long-cap on huggingface.co

11.3K
Total runs
-439
24-hour runs
-1.0K
3-day runs
-1.5K
7-day runs
3.5K
30-day runs

More Information About blip-large-long-cap huggingface.co Model

More blip-large-long-cap license Visit here:

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

blip-large-long-cap huggingface.co

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

blip-large-long-cap huggingface.co Url

https://huggingface.co/unography/blip-large-long-cap

unography blip-large-long-cap online free

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

unography blip-large-long-cap online free url in huggingface.co:

https://huggingface.co/unography/blip-large-long-cap

blip-large-long-cap install

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

blip-large-long-cap install url in huggingface.co:

https://huggingface.co/unography/blip-large-long-cap

Url of blip-large-long-cap

blip-large-long-cap huggingface.co Url

Provider of blip-large-long-cap huggingface.co

unography
ORGANIZATIONS

Other API from unography