google / siglip-so400m-patch14-384

huggingface.co
Total runs: 2.8M
24-hour runs: 0
7-day runs: -29.8K
30-day runs: -215.0K
Model's Last Updated: September 26 2024
zero-shot-image-classification

Introduction of siglip-so400m-patch14-384

Model Details of siglip-so400m-patch14-384

SigLIP (shape-optimized 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 .

This model has the SoViT-400m architecture, which is the shape-optimized version as presented in Getting ViT in Shape: Scaling Laws for Compute-Optimal Model Design by Alabdulmohsin et al.

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-so400m-patch14-384")
processor = AutoProcessor.from_pretrained("google/siglip-so400m-patch14-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-so400m-patch14-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 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-so400m-patch14-384 on huggingface.co

2.8M
Total runs
0
24-hour runs
132.6K
3-day runs
-29.8K
7-day runs
-215.0K
30-day runs

More Information About siglip-so400m-patch14-384 huggingface.co Model

More siglip-so400m-patch14-384 license Visit here:

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

siglip-so400m-patch14-384 huggingface.co

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

siglip-so400m-patch14-384 huggingface.co Url

https://huggingface.co/google/siglip-so400m-patch14-384

google siglip-so400m-patch14-384 online free

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

google siglip-so400m-patch14-384 online free url in huggingface.co:

https://huggingface.co/google/siglip-so400m-patch14-384

siglip-so400m-patch14-384 install

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

siglip-so400m-patch14-384 install url in huggingface.co:

https://huggingface.co/google/siglip-so400m-patch14-384

Url of siglip-so400m-patch14-384

siglip-so400m-patch14-384 huggingface.co Url

Provider of siglip-so400m-patch14-384 huggingface.co

google
ORGANIZATIONS

Other API from google

huggingface.co

Total runs: 2.4M
Run Growth: 870.4K
Growth Rate: 36.66%
Updated: July 17 2023
huggingface.co

Total runs: 1.5M
Run Growth: -154.5K
Growth Rate: -10.77%
Updated: January 25 2023
huggingface.co

Total runs: 917.7K
Run Growth: 231.3K
Growth Rate: 25.20%
Updated: February 29 2024
huggingface.co

Total runs: 787.5K
Run Growth: 24.3K
Growth Rate: 3.08%
Updated: January 25 2023
huggingface.co

Total runs: 782.0K
Run Growth: 225.9K
Growth Rate: 28.89%
Updated: July 17 2023
huggingface.co

Total runs: 749.9K
Run Growth: 46.1K
Growth Rate: 6.15%
Updated: July 27 2023
huggingface.co

Total runs: 541.7K
Run Growth: 8.4K
Growth Rate: 1.58%
Updated: October 11 2023
huggingface.co

Total runs: 442.5K
Run Growth: 66.7K
Growth Rate: 15.08%
Updated: August 28 2024
huggingface.co

Total runs: 388.8K
Run Growth: 76.8K
Growth Rate: 19.74%
Updated: August 28 2024
huggingface.co

Total runs: 379.2K
Run Growth: 185.2K
Growth Rate: 48.85%
Updated: November 28 2023
huggingface.co

Total runs: 243.9K
Run Growth: -82.0K
Growth Rate: -33.62%
Updated: September 27 2024
huggingface.co

Total runs: 233.4K
Run Growth: 37.5K
Growth Rate: 16.05%
Updated: August 08 2024
huggingface.co

Total runs: 233.1K
Run Growth: 139.9K
Growth Rate: 60.03%
Updated: February 17 2023
huggingface.co

Total runs: 198.8K
Run Growth: 93.5K
Growth Rate: 47.04%
Updated: August 28 2024
huggingface.co

Total runs: 172.7K
Run Growth: 105.7K
Growth Rate: 61.20%
Updated: January 25 2023
huggingface.co

Total runs: 142.4K
Run Growth: 15.1K
Growth Rate: 10.58%
Updated: November 07 2023
huggingface.co

Total runs: 128.4K
Run Growth: 31.2K
Growth Rate: 24.89%
Updated: September 18 2023
huggingface.co

Total runs: 116.4K
Run Growth: -993
Growth Rate: -0.85%
Updated: January 25 2023
huggingface.co

Total runs: 110.9K
Run Growth: 48.6K
Growth Rate: 43.85%
Updated: September 27 2024
huggingface.co

Total runs: 108.2K
Run Growth: 19.7K
Growth Rate: 18.19%
Updated: January 25 2023
huggingface.co

Total runs: 106.8K
Run Growth: 28.3K
Growth Rate: 26.52%
Updated: January 25 2023
huggingface.co

Total runs: 101.3K
Run Growth: -38.0K
Growth Rate: -37.50%
Updated: January 25 2023
huggingface.co

Total runs: 87.8K
Run Growth: -71.5K
Growth Rate: -81.43%
Updated: January 25 2023
huggingface.co

Total runs: 87.3K
Run Growth: 239
Growth Rate: 0.27%
Updated: January 25 2023
huggingface.co

Total runs: 78.9K
Run Growth: -40.1K
Growth Rate: -50.85%
Updated: August 08 2024
huggingface.co

Total runs: 71.8K
Run Growth: 36.2K
Growth Rate: 50.46%
Updated: June 27 2024
huggingface.co

Total runs: 59.5K
Run Growth: 43.2K
Growth Rate: 74.44%
Updated: January 25 2023
huggingface.co

Total runs: 54.8K
Run Growth: -237.5K
Growth Rate: -433.70%
Updated: August 14 2024
huggingface.co

Total runs: 37.9K
Run Growth: 15.4K
Growth Rate: 40.66%
Updated: April 29 2024
huggingface.co

Total runs: 37.3K
Run Growth: -685
Growth Rate: -1.83%
Updated: January 25 2023
huggingface.co

Total runs: 23.2K
Run Growth: 17.5K
Growth Rate: 75.46%
Updated: January 25 2023
huggingface.co

Total runs: 17.5K
Run Growth: -10.7K
Growth Rate: -62.40%
Updated: September 07 2023
huggingface.co

Total runs: 13.6K
Run Growth: 3.4K
Growth Rate: 24.69%
Updated: February 17 2023
huggingface.co

Total runs: 12.5K
Run Growth: 6.4K
Growth Rate: 50.74%
Updated: April 29 2024
huggingface.co

Total runs: 11.3K
Run Growth: -43.6K
Growth Rate: -385.61%
Updated: August 08 2024
huggingface.co

Total runs: 10.7K
Run Growth: 10.3K
Growth Rate: 96.13%
Updated: July 23 2023
huggingface.co

Total runs: 10.2K
Run Growth: 2.7K
Growth Rate: 26.21%
Updated: September 07 2023
huggingface.co

Total runs: 9.5K
Run Growth: 4.6K
Growth Rate: 49.09%
Updated: July 06 2023
huggingface.co

Total runs: 8.5K
Run Growth: 6.6K
Growth Rate: 77.25%
Updated: August 08 2024