Downloads · 30 days
26
23% of all-time downloads
pigzhou/fg-clip2-base-immich
fg-clip2-base-immich is a zero-shot image classification model from pigzhou. Use it for the zero-shot image classification task on the model card, and read the license before you ship it in a product. It is set up for onnx. The card lists the license as apache-2.0.
ONNX conversion of qihoo360/fg-clip2-base (bilingual zh/en, fine-grained CLIP, 384M params) in the exact cache layout and input/output convention expected by Immich's Smart Search (immichml OpenClip loaders). Intended…
Downloads · 30 days
26
23% of all-time downloads
All-time downloads
113
Public
Repo size
1.5 GB
Likes
1
Public
Click a slice to open those files.
.onnx1.5 GB · 98%
From the Hugging Face model README
ONNX conversion of qihoo360/fg-clip2-base
(bilingual zh/en, fine-grained CLIP, 384M params) in the exact cache layout and
input/output convention expected by Immich's Smart Search
(immich_ml OpenClip loaders). Intended for upstream support in immich-app/immich
(whitelist + CLIP_MODEL_INFO entry); until merged, use it by placing the files in the
ML cache folder and patching the two whitelists (see below).
<MACHINE_LEARNING_CACHE_FOLDER>/clip/fg-clip2-base/)config.json # {"text_cfg": {"context_length": 64}}
textual/model.onnx # input "text" int32 (1,64) -> output "embedding" (1,768)
textual/tokenizer.json
textual/tokenizer_config.json # pad_token <pad> = 0
visual/model.onnx # input "image" float32 (1,3,512,512) -> "embedding" (1,768)
visual/preprocess_cfg.json # {"size":512,"mean/std":[0.5]*3,"interpolation":"bicubic"}
attn_implementation="eager", fp32, opset 17, dynamo=False.tokenizers with
enable_padding(length=64) — verified byte-identical to the HF tokenizer, and
(input_ids != 0) == attention_mask holds (unused, kept for reference).residual + mlp(layernorm(residual)).OpenClipTextualEncoder / OpenClipVisualEncoder) load the
package and reproduce the reference (cos = 1.0); retrieval sanity 13/13 top-1 on a
bilingual query set.Requires two whitelist entries (PR prepared for immich-app/immich):
machine-learning/immich_ml/models/constants.py _OPENCLIP_MODELS += fg-clip2-base;
server/src/constants.ts CLIP_MODEL_INFO += 'fg-clip2-base': { dimSize: 768 }.
Then set the model name in Administration → Settings → Smart Search and re-run the
Smart Search job.
License: Apache-2.0 (inherits qihoo360/FG-CLIP).