Downloads · 30 days
0
hannalaguilar/blip-all-clothing
blip-all-clothing is a machine learning model from hannalaguilar. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
Downloads · 30 days
0
Access
Public
Updated Feb 3, 2025
Repo size
38 MB
Likes
1
Public
Click a slice to open those files.
.safetensors38 MB · 98%
From the Hugging Face model README
Captioning model for garments.
import requests
from PIL import Image
from transformers import BlipProcessor, BlipForConditionalGeneration
# Load BLIP processor and model
processor = BlipProcessor.from_pretrained("hannalaguilar/blip-all-clothing")
model = BlipForConditionalGeneration.from_pretrained("hannalaguilar/blip-all-clothing")
# Load model
img_path = 'tshirt.jpg'
image = Image.open(img_path).convert('RGB')
# Process the image
inputs = processor(images=image, return_tensors="pt")
# Generate captions
outputs = model.generate(**inputs)
caption = processor.decode(outputs[0], skip_special_tokens=True)
print("Generated Caption:", caption)
[More Information Needed]