Views
No views yet
340,000 coin images using contrastive learning techniques. This specialized model is designed to significantly improve feature extraction for coin images, leading to more accurate image-based search capabilities. Coin-CLIP combines the power of Visual Transformer (ViT) with CLIP's multimodal learning capabilities, specifically tailored for the numismatic domain.340,000 张硬币图片数据上微调得到的。
Coin-CLIP 旨在提高模型针对硬币图片的特征提取能力,从而实现更准确的以图搜图功能。该模型结合了视觉变换器(ViT)的强大功能和 CLIP 的多模态学习能力,并专门针对硬币图片进行了优化。

1from PIL import Image
2import requests
3
4import torch.nn.functional as F
5from transformers import CLIPProcessor, CLIPModel
6
7model = CLIPModel.from_pretrained("breezedeus/coin-clip-vit-base-patch32")
8processor = CLIPProcessor.from_pretrained("breezedeus/coin-clip-vit-base-patch32")
9
10image_fp = "path/to/coin_image.jpg"
11image = Image.open(image_fp).convert("RGB")
12
13inputs = processor(images=image, return_tensors="pt")
14img_features = model.get_image_features(**inputs)
15img_features = F.normalize(img_features, dim=1)pip install coin_clip1from coin_clip import CoinClip
2
3# Automatically download the model from Huggingface
4model = CoinClip(model_name='breezedeus/coin-clip-vit-base-patch32')
5images = ['examples/10_back.jpg', 'examples/16_back.jpg']
6img_feats, success_ids = model.get_image_features(images)
7print(img_feats.shape) # --> (2, 512)Where to send questions or comments about the model.