Saltar al contenido
ModelPublicadoExterno
Descargar

BLIP Image To Recipe

import requests from PIL import Image

TipoText modelVersiónmodelCcalidad

Fuente del modelo

Tipo
Text model
Tamaño del archivo
944 MB
Versión
vmodel
Actualizado
7 oct 2026
Descargas
5
Fuente
Hugging Face

Descripción de la fuente

BLIP-Image-to-recip

Inference code


import requests from PIL import Image

from transformers import BlipForConditionalGeneration, AutoProcessor

img_url = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSQuFg4LTHUattLGPU0kLzYpBGHRtuqgJY8Gho3uZe_cg&s' image = Image.open(requests.get(img_url, stream=True).raw).convert('RGB')

model = BlipForConditionalGeneration.from_pretrained("Fatehmujtaba/BLIP-Image-to-recipe").to(device) processor = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-base")

inputs = processor(images=image, return_tensors="pt").to(device) pixel_values = inputs.pixel_values generated_ids = model.generate(pixel_values=pixel_values, max_length=50) generated_caption = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]


Fuentes

1 fuente
Hugging FacePrincipalVersión b206555b13f709db7b8fc5d39b0b5432d8df0965
huggingface.co/fatehmujtaba/BLIP-Image-to-recipe/tree/b206555b13f709db7b8fc5d39b0b5432d8df0965

Verificado 7 oct

Artefactos del modelo

1 artefacto

model.safetensors

safetensors · 944 MB · SHA-256 028246ed7d2f…c43c · Hugging Face

Descargar

Extractos de fuentes

3 extractos

--- library_name: transformers license: apache-2.0 pipeline_tag: image-to-text --- # BLIP-Image-to-recip # Inference code --- import requests from PIL import Image from transformers import BlipForConditionalGeneration, AutoProcessor img_url = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSQuFg4LTHUattLGPU0kLzYpBGHRtuqgJY8Gho3uZe_cg&s' image = Image.open(requests.get(img_url, stream=True).raw).convert('RGB') model = BlipForConditionalGeneration.from_pretrained("Fatehmujtaba/BLIP-Image-to-recipe").to(device) processor = AutoProcessor.from_pretrained("Salesforce/blip-image-captioning-base") inputs = processor(images=image, return_tensors="pt").to(device) pixel_values = inputs.pixel_values generated_ids = model.generate(pixel_values=pixel_values, max_length=50) generated_caption = processor.batch_decode(generated_ids, skip_special_tokens=True)[0] ---

Source context: 5 downloads · 0 likes · Pipeline image-to-text · Library transformers · Repo fatehmujtaba/BLIP-Image-to-recipe

Source context: 4 downloads · 0 likes · Pipeline image-to-text · Library transformers · Repo fatehmujtaba/BLIP-Image-to-recipe