google / siglip-large-patch16-384

huggingface.co
Total runs: 175.5K
24-hour runs: -121
7-day runs: 163.0K
30-day runs: 164.9K
Model's Last Updated: Tháng 9 26 2024
zero-shot-image-classification

Introduction of siglip-large-patch16-384

Model Details of siglip-large-patch16-384

SigLIP (large-sized model)

SigLIP model pre-trained on WebLi at resolution 384x384. It was introduced in the paper Sigmoid Loss for Language Image Pre-Training by Zhai et al. and first released in this repository .

Disclaimer: The team releasing SigLIP did not write a model card for this model so this model card has been written by the Hugging Face team.

Model description

SigLIP is CLIP , a multimodal model, with a better loss function. The sigmoid loss operates solely on image-text pairs and does not require a global view of the pairwise similarities for normalization. This allows further scaling up the batch size, while also performing better at smaller batch sizes.

A TLDR of SigLIP by one of the authors can be found here .

Intended uses & limitations

You can use the raw model for tasks like zero-shot image classification and image-text retrieval. See the model hub to look for other versions on a task that interests you.

How to use

Here is how to use this model to perform zero-shot image classification:

from PIL import Image
import requests
from transformers import AutoProcessor, AutoModel
import torch

model = AutoModel.from_pretrained("google/siglip-large-patch16-384")
processor = AutoProcessor.from_pretrained("google/siglip-large-patch16-384")

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

texts = ["a photo of 2 cats", "a photo of 2 dogs"]
inputs = processor(text=texts, images=image, padding="max_length", return_tensors="pt")

with torch.no_grad():
    outputs = model(**inputs)

logits_per_image = outputs.logits_per_image
probs = torch.sigmoid(logits_per_image) # these are the probabilities
print(f"{probs[0][0]:.1%} that image 0 is '{texts[0]}'")

Alternatively, one can leverage the pipeline API which abstracts away the complexity for the user:

from transformers import pipeline
from PIL import Image
import requests

# load pipe
image_classifier = pipeline(task="zero-shot-image-classification", model="google/siglip-large-patch16-384")

# load image
url = 'http://images.cocodataset.org/val2017/000000039769.jpg'
image = Image.open(requests.get(url, stream=True).raw)

# inference
outputs = image_classifier(image, candidate_labels=["2 cats", "a plane", "a remote"])
outputs = [{"score": round(output["score"], 4), "label": output["label"] } for output in outputs]
print(outputs)

For more code examples, we refer to the documentation .

Training procedure
Training data

SigLIP is pre-trained on the English image-text pairs of the WebLI dataset (Chen et al., 2023) .

Preprocessing

Images are resized/rescaled to the same resolution (384x384) and normalized across the RGB channels with mean (0.5, 0.5, 0.5) and standard deviation (0.5, 0.5, 0.5).

Texts are tokenized and padded to the same length (64 tokens).

Compute

The model was trained on 16 TPU-v4 chips for three days.

Evaluation results

Evaluation of SigLIP compared to CLIP is shown below (taken from the paper).

drawing

BibTeX entry and citation info
@misc{zhai2023sigmoid,
      title={Sigmoid Loss for Language Image Pre-Training}, 
      author={Xiaohua Zhai and Basil Mustafa and Alexander Kolesnikov and Lucas Beyer},
      year={2023},
      eprint={2303.15343},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

Runs of google siglip-large-patch16-384 on huggingface.co

175.5K
Total runs
-121
24-hour runs
2.5K
3-day runs
163.0K
7-day runs
164.9K
30-day runs

More Information About siglip-large-patch16-384 huggingface.co Model

More siglip-large-patch16-384 license Visit here:

https://choosealicense.com/licenses/apache-2.0

siglip-large-patch16-384 huggingface.co

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

siglip-large-patch16-384 huggingface.co Url

https://huggingface.co/google/siglip-large-patch16-384

google siglip-large-patch16-384 online free

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

google siglip-large-patch16-384 online free url in huggingface.co:

https://huggingface.co/google/siglip-large-patch16-384

siglip-large-patch16-384 install

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

siglip-large-patch16-384 install url in huggingface.co:

https://huggingface.co/google/siglip-large-patch16-384

Url of siglip-large-patch16-384

siglip-large-patch16-384 huggingface.co Url

Provider of siglip-large-patch16-384 huggingface.co

google
ORGANIZATIONS

Other API from google

huggingface.co

Total runs: 2.5M
Run Growth: -11.2M
Growth Rate: -447.68%
Updated: Tháng tám 08 2024
huggingface.co

Total runs: 2.1M
Run Growth: -243.4K
Growth Rate: -11.60%
Updated: Tháng Một 25 2023
huggingface.co

Total runs: 1.7M
Run Growth: -1.7M
Growth Rate: -99.87%
Updated: Tháng hai 29 2024
huggingface.co

Total runs: 1.5M
Run Growth: 103.0K
Growth Rate: 6.67%
Updated: Tháng tư 29 2024
huggingface.co

Total runs: 1.4M
Run Growth: 545.7K
Growth Rate: 39.39%
Updated: Tháng Một 25 2023
huggingface.co

Total runs: 1.3M
Run Growth: 250.3K
Growth Rate: 18.96%
Updated: Tháng bảy 17 2023
huggingface.co

Total runs: 842.4K
Run Growth: 297.8K
Growth Rate: 35.35%
Updated: Tháng tám 28 2024
huggingface.co

Total runs: 722.5K
Run Growth: 614.9K
Growth Rate: 85.11%
Updated: Tháng tám 14 2024
huggingface.co

Total runs: 635.2K
Run Growth: 72.6K
Growth Rate: 11.60%
Updated: Tháng bảy 27 2023
huggingface.co

Total runs: 623.0K
Run Growth: 84.9K
Growth Rate: 13.63%
Updated: Tháng bảy 17 2023
huggingface.co

Total runs: 488.6K
Run Growth: 166.3K
Growth Rate: 34.03%
Updated: Tháng Mười 11 2023
huggingface.co

Total runs: 438.8K
Run Growth: 286.9K
Growth Rate: 99.62%
Updated: Tháng tám 03 2023
huggingface.co

Total runs: 391.6K
Run Growth: -133.7K
Growth Rate: -34.14%
Updated: Tháng 9 27 2024
huggingface.co

Total runs: 320.1K
Run Growth: -121.1K
Growth Rate: -37.82%
Updated: Tháng tám 28 2024
huggingface.co

Total runs: 243.9K
Run Growth: 125.7K
Growth Rate: 51.56%
Updated: Tháng Một 25 2023
huggingface.co

Total runs: 210.4K
Run Growth: 72.5K
Growth Rate: 34.44%
Updated: Tháng mười một 07 2023
huggingface.co

Total runs: 210.0K
Run Growth: -418.5K
Growth Rate: -199.29%
Updated: Tháng Một 25 2023
huggingface.co

Total runs: 205.7K
Run Growth: -37.8K
Growth Rate: -18.37%
Updated: Tháng tám 28 2024
huggingface.co

Total runs: 190.7K
Run Growth: 54.8K
Growth Rate: 28.72%
Updated: Tháng mười một 28 2023
huggingface.co

Total runs: 153.1K
Run Growth: -6.0K
Growth Rate: -3.98%
Updated: Tháng Một 25 2023
huggingface.co

Total runs: 146.4K
Run Growth: -49.8K
Growth Rate: -34.00%
Updated: Tháng 9 07 2023
huggingface.co

Total runs: 133.1K
Run Growth: -207.2K
Growth Rate: -155.62%
Updated: Tháng sáu 27 2024
huggingface.co

Total runs: 120.8K
Run Growth: -8.2K
Growth Rate: -6.76%
Updated: Tháng 9 18 2023
huggingface.co

Total runs: 108.6K
Run Growth: 22.2K
Growth Rate: 20.45%
Updated: Tháng Một 25 2023
huggingface.co

Total runs: 107.5K
Run Growth: 92.0K
Growth Rate: 85.64%
Updated: Tháng tám 08 2024
huggingface.co

Total runs: 104.1K
Run Growth: 22.4K
Growth Rate: 21.51%
Updated: Tháng sáu 27 2024
huggingface.co

Total runs: 102.4K
Run Growth: -225.5K
Growth Rate: -220.23%
Updated: Tháng Một 25 2023
huggingface.co

Total runs: 95.3K
Run Growth: 20.2K
Growth Rate: 21.17%
Updated: Tháng Một 25 2023
huggingface.co

Total runs: 94.0K
Run Growth: 1.3K
Growth Rate: 1.33%
Updated: Tháng 9 27 2024
huggingface.co

Total runs: 77.3K
Run Growth: -89.2K
Growth Rate: -115.37%
Updated: Tháng tám 08 2024
huggingface.co

Total runs: 62.8K
Run Growth: 3.9K
Growth Rate: 6.21%
Updated: Tháng Một 25 2023
huggingface.co

Total runs: 61.3K
Run Growth: 11.3K
Growth Rate: 18.40%
Updated: Tháng Một 25 2023
huggingface.co

Total runs: 46.7K
Run Growth: 12.0K
Growth Rate: 25.63%
Updated: Tháng tám 03 2023
huggingface.co

Total runs: 46.0K
Run Growth: 32.7K
Growth Rate: 71.05%
Updated: Tháng Một 25 2023
huggingface.co

Total runs: 43.1K
Run Growth: 41.4K
Growth Rate: 95.91%
Updated: Tháng mười một 29 2021
huggingface.co

Total runs: 26.0K
Run Growth: -12.8K
Growth Rate: -49.20%
Updated: Tháng mười một 27 2023
huggingface.co

Total runs: 24.3K
Run Growth: 15.2K
Growth Rate: 62.66%
Updated: Tháng tám 08 2024
huggingface.co

Total runs: 23.2K
Run Growth: 4.5K
Growth Rate: 18.02%
Updated: Tháng Một 25 2023
huggingface.co

Total runs: 17.5K
Run Growth: 1.1K
Growth Rate: 6.22%
Updated: Tháng sáu 27 2024
huggingface.co

Total runs: 10.2K
Run Growth: 1.4K
Growth Rate: 13.47%
Updated: Tháng bảy 06 2023
huggingface.co

Total runs: 9.7K
Run Growth: 2.7K
Growth Rate: 27.59%
Updated: Tháng tư 29 2024
huggingface.co

Total runs: 8.8K
Run Growth: -31.5K
Growth Rate: -357.66%
Updated: Tháng 9 07 2023
huggingface.co

Total runs: 7.7K
Run Growth: -5.1K
Growth Rate: -66.50%
Updated: Tháng Một 25 2023