Marqo Fashionsiglip
Marqo-FashionSigLIP 是一種多模態嵌入模型,專為時尚產品搜索優化,相比 FashionCLIP 在 MRR 和召回率上提升了57%。
下載量 493.25k
發布時間 : 8/9/2024
模型概述
該模型利用廣義對比學習進行訓練,支持基於文本描述、類別、風格、顏色、材質等多種特徵的時尚產品檢索,提供高度相關的搜索結果。
模型特點
廣義對比學習
利用廣義對比學習(GCL)進行訓練,支持多模態檢索和排序,提升搜索相關性。
多模態嵌入
能夠同時處理圖像和文本輸入,生成統一的嵌入表示。
時尚領域優化
專門針對時尚產品進行優化,在多個時尚數據集上表現優異。
模型能力
零樣本圖像分類
多模態檢索
時尚產品搜索
圖像-文本匹配
使用案例
電子商務
時尚產品搜索
根據文本描述或圖像搜索相關時尚產品。
在多個時尚數據集上平均召回率提升57%
產品分類
自動對時尚產品進行分類。
在類別到產品任務中平均精確率達0.737
🚀 Marqo-FashionSigLIP模型卡片
Marqo-FashionSigLIP是一個多模態嵌入模型,與fashion clip相比,它在平均倒數排名(MRR)和召回率方面最高可提升57%。該模型利用廣義對比學習(GCL),不僅可以基於文本描述進行訓練,還能結合類別、風格、顏色、材質、關鍵詞和細節信息,為時尚產品搜索提供高度相關的結果。此模型是基於ViT - B - 16 - SigLIP(webli)進行微調得到的。
GitHub頁面:Marqo - FashionCLIP
博客:Marqo博客
🚀 快速開始
💻 使用示例
基礎用法
以下是在Hugging Face上使用該模型的示例代碼:
from transformers import AutoModel, AutoProcessor
model = AutoModel.from_pretrained('Marqo/marqo-fashionSigLIP', trust_remote_code=True)
processor = AutoProcessor.from_pretrained('Marqo/marqo-fashionSigLIP', trust_remote_code=True)
import torch
from PIL import Image
image = [Image.open("docs/fashion-hippo.png")]
text = ["a hat", "a t-shirt", "shoes"]
processed = processor(text=text, images=image, padding='max_length', return_tensors="pt")
with torch.no_grad():
image_features = model.get_image_features(processed['pixel_values'], normalize=True)
text_features = model.get_text_features(processed['input_ids'], normalize=True)
text_probs = (100.0 * image_features @ text_features.T).softmax(dim=-1)
print("Label probs:", text_probs)
# [0.98379946, 0.01294010, 0.00326044]
高級用法
可以使用OpenCLIP庫來使用該模型:
import open_clip
model, preprocess_train, preprocess_val = open_clip.create_model_and_transforms('hf-hub:Marqo/marqo-fashionSigLIP')
tokenizer = open_clip.get_tokenizer('hf-hub:Marqo/marqo-fashionSigLIP')
import torch
from PIL import Image
image = preprocess_val(Image.open("docs/fashion-hippo.png")).unsqueeze(0)
text = tokenizer(["a hat", "a t-shirt", "shoes"])
with torch.no_grad(), torch.cuda.amp.autocast():
image_features = model.encode_image(image, normalize=True)
text_features = model.encode_text(text, normalize=True)
text_probs = (100.0 * image_features @ text_features.T).softmax(dim=-1)
print("Label probs:", text_probs)
# [0.9860219105287394, 0.00777916527489097, 0.006198924196369721]
還可以使用Transformers.js庫在JavaScript中運行該模型:
import { SiglipTextModel, SiglipVisionModel, AutoTokenizer, AutoProcessor, RawImage, softmax, dot } from '@huggingface/transformers';
const model_id = 'Marqo/marqo-fashionSigLIP';
// Load tokenizer and text model
const tokenizer = await AutoTokenizer.from_pretrained(model_id);
const text_model = await SiglipTextModel.from_pretrained(model_id);
// Load processor and vision model
const processor = await AutoProcessor.from_pretrained(model_id);
const vision_model = await SiglipVisionModel.from_pretrained(model_id);
// Run tokenization
const texts = ['a hat', 'a t-shirt', 'shoes'];
const text_inputs = tokenizer(texts, { padding: 'max_length', truncation: true });
// Compute text embeddings
const { text_embeds } = await text_model(text_inputs);
// Read image and run processor
const image = await RawImage.read('https://raw.githubusercontent.com/marqo-ai/marqo-FashionCLIP/main/docs/fashion-hippo.png');
const image_inputs = await processor(image);
// Compute vision embeddings
const { image_embeds } = await vision_model(image_inputs);
// Compute similarity scores
const normalized_text_embeds = text_embeds.normalize().tolist();
const normalized_image_embeds = image_embeds.normalize().tolist()[0];
const text_probs = softmax(normalized_text_embeds.map((text_embed) =>
100.0 * dot(normalized_image_embeds, text_embed)
));
console.log(text_probs);
// [0.9860219105287394, 0.00777916527489097, 0.006198924196369721]
📚 詳細文檔
基準測試結果
以下是該模型在6個公開多模態時尚數據集(Atlas、DeepFashion (In - shop)、DeepFashion (Multimodal)、Fashion200k、KAGL和Polyvore)上的平均評估結果:
文本到圖像(6個數據集的平均值)
模型 | 平均召回率 | 召回率@1 | 召回率@10 | 平均倒數排名(MRR) |
---|---|---|---|---|
Marqo - FashionSigLIP | 0.231 | 0.121 | 0.340 | 0.239 |
FashionCLIP2.0 | 0.163 | 0.077 | 0.249 | 0.165 |
OpenFashionCLIP | 0.132 | 0.060 | 0.204 | 0.135 |
ViT - B - 16 - laion2b_s34b_b88k | 0.174 | 0.088 | 0.261 | 0.180 |
ViT - B - 16 - SigLIP - webli | 0.212 | 0.111 | 0.314 | 0.214 |
類別到產品(5個數據集的平均值)
模型 | 平均準確率 | 準確率@1 | 準確率@10 | 平均倒數排名(MRR) |
---|---|---|---|---|
Marqo - FashionSigLIP | 0.737 | 0.758 | 0.716 | 0.812 |
FashionCLIP2.0 | 0.684 | 0.681 | 0.686 | 0.741 |
OpenFashionCLIP | 0.646 | 0.653 | 0.639 | 0.720 |
ViT - B - 16 - laion2b_s34b_b88k | 0.662 | 0.673 | 0.652 | 0.743 |
ViT - B - 16 - SigLIP - webli | 0.688 | 0.690 | 0.685 | 0.751 |
子類別到產品(4個數據集的平均值)
模型 | 平均準確率 | 準確率@1 | 準確率@10 | 平均倒數排名(MRR) |
---|---|---|---|---|
Marqo - FashionSigLIP | 0.725 | 0.767 | 0.683 | 0.811 |
FashionCLIP2.0 | 0.657 | 0.676 | 0.638 | 0.733 |
OpenFashionCLIP | 0.598 | 0.619 | 0.578 | 0.689 |
ViT - B - 16 - laion2b_s34b_b88k | 0.638 | 0.651 | 0.624 | 0.712 |
ViT - B - 16 - SigLIP - webli | 0.643 | 0.643 | 0.643 | 0.726 |
📄 許可證
本項目採用Apache 2.0許可證。
Clip Vit Large Patch14 336
基於Vision Transformer架構的大規模視覺語言預訓練模型,支持圖像與文本的跨模態理解
文本生成圖像
Transformers

C
openai
5.9M
241
Fashion Clip
MIT
FashionCLIP是基於CLIP開發的視覺語言模型,專門針對時尚領域進行微調,能夠生成通用產品表徵。
文本生成圖像
Transformers 英語

F
patrickjohncyh
3.8M
222
Gemma 3 1b It
Gemma 3是Google推出的輕量級先進開放模型系列,基於與Gemini模型相同的研究和技術構建。該模型是多模態模型,能夠處理文本和圖像輸入並生成文本輸出。
文本生成圖像
Transformers

G
google
2.1M
347
Blip Vqa Base
Bsd-3-clause
BLIP是一個統一的視覺語言預訓練框架,擅長視覺問答任務,通過語言-圖像聯合訓練實現多模態理解與生成能力
文本生成圖像
Transformers

B
Salesforce
1.9M
154
CLIP ViT H 14 Laion2b S32b B79k
MIT
基於OpenCLIP框架在LAION-2B英文數據集上訓練的視覺-語言模型,支持零樣本圖像分類和跨模態檢索任務
文本生成圖像
Safetensors
C
laion
1.8M
368
CLIP ViT B 32 Laion2b S34b B79k
MIT
基於OpenCLIP框架在LAION-2B英語子集上訓練的視覺-語言模型,支持零樣本圖像分類和跨模態檢索
文本生成圖像
Safetensors
C
laion
1.1M
112
Pickscore V1
PickScore v1 是一個針對文本生成圖像的評分函數,可用於預測人類偏好、評估模型性能和圖像排序等任務。
文本生成圖像
Transformers

P
yuvalkirstain
1.1M
44
Owlv2 Base Patch16 Ensemble
Apache-2.0
OWLv2是一種零樣本文本條件目標檢測模型,可通過文本查詢在圖像中定位對象。
文本生成圖像
Transformers

O
google
932.80k
99
Llama 3.2 11B Vision Instruct
Llama 3.2 是 Meta 發佈的多語言多模態大型語言模型,支持圖像文本到文本的轉換任務,具備強大的跨模態理解能力。
文本生成圖像
Transformers 支持多種語言

L
meta-llama
784.19k
1,424
Owlvit Base Patch32
Apache-2.0
OWL-ViT是一個零樣本文本條件目標檢測模型,可以通過文本查詢搜索圖像中的對象,無需特定類別的訓練數據。
文本生成圖像
Transformers

O
google
764.95k
129
精選推薦AI模型
Llama 3 Typhoon V1.5x 8b Instruct
專為泰語設計的80億參數指令模型,性能媲美GPT-3.5-turbo,優化了應用場景、檢索增強生成、受限生成和推理任務
大型語言模型
Transformers 支持多種語言

L
scb10x
3,269
16
Cadet Tiny
Openrail
Cadet-Tiny是一個基於SODA數據集訓練的超小型對話模型,專為邊緣設備推理設計,體積僅為Cosmo-3B模型的2%左右。
對話系統
Transformers 英語

C
ToddGoldfarb
2,691
6
Roberta Base Chinese Extractive Qa
基於RoBERTa架構的中文抽取式問答模型,適用於從給定文本中提取答案的任務。
問答系統 中文
R
uer
2,694
98