AIToday
Image GenerationOpen-Source AIQiita 機械学習Published: Oct 17, 2026, 19:01 JST

openclip-gemma brings EmbeddingGemma 2 to OpenCLIP-style Python

openclip-gemma brings EmbeddingGemma 2 to OpenCLIP-style Python

3 Key Points

  1. What happened

    A developer published openclip-gemma on PyPI, a wrapper that runs EmbeddingGemma 2 image and text embedding through create_model_and_transforms(), get_tokenizer(), encode_image() and encode_text().

  2. Why it matters

    It lets developers reuse a familiar OpenCLIP-style API and produce 768-dimension vectors, though it is an unofficial personal project and not a full OpenCLIP replacement.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, in your inbox every morning.

Context & Analysis

The project grew out of a personal frustration: the developer uses CLIP regularly but struggled to tune it for specific scene detection. When EmbeddingGemma 2 appeared, it offered image-text comparison like CLIP but was built on different principles, so it could not be used the same way. The wrapper is an attempt to bridge that gap while keeping the official preprocessing, tokenizer, prompt, pooling and normalization logic intact, with model weights pulled from Hugging Face at runtime rather than bundled.

The developer reports close alignment with the official inference path: on Windows 11, Python 3.12 and CPU FP32, the maximum absolute error was about 2.74 × 10⁻⁷ for image embeddings, 2.81 × 10⁻⁶ for text embeddings, and 1.19 × 10⁻⁶ for image-text similarity. Those figures compare against Sentence Transformers inference for a specific model revision and test environment, so they indicate fidelity in that setup rather than proven accuracy on specific classification or retrieval tasks. The pre-release checks covered 75 passing pytest tests with 9 skipped, a real-model CPU integration test, and automated CI and PyPI publishing via GitHub Actions.

The library is positioned narrowly: v0.1.0 supports only EmbeddingGemma 2, handles images and text (not video or audio), and omits some OpenCLIP features such as forward() and get_logits(). The developer plans to widen platform support and improve documentation based on usage, and notes the name may change to respect existing project trademarks, with migration guidance to follow on GitHub.

FAQ
Is openclip-gemma an official Google or OpenCLIP project?
No. The developer states it is an unofficial personal project with no affiliation with or endorsement from Google, Google DeepMind, or the OpenCLIP project.
Does it work as a drop-in replacement for existing OpenCLIP code?
No. It is not a complete compatibility implementation; only import statements alone will not guarantee existing OpenCLIP code runs, because preprocessing, tokenization and prompting differ by model.
Can I fine-tune or train models with it?
No. The library is inference-only and does not support training or fine-tuning.
Qiita 機械学習Read Original Article

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleAgentsView tracks 60+ AI coding agents' cost locally