Predicts
font family (75)
,
language (11)
,
color (64, EGA index)
, and
style (4)
from a text-image crop. Backbone:
google/siglip2-base-patch16-naflex
(native aspect ratio,
max_num_patches=256
); pooled feature (d=768) from the
SigLIP2 attention-pooling head feeds four independent heads
(
Linear(768→512) → LayerNorm → GELU → Dropout(0.1) → Linear(512→n)
).
Results (DataFontID test)
font
language
color
style
96.34
96.19
95.92
96.98
Wild1024 out-of-distribution: language 82.42, font-category 89.55.
Usage
from huggingface_hub import snapshot_download
import sys, torch, json
from transformers import AutoProcessor
from PIL import Image
path = snapshot_download("issai/FontID")
sys.path.insert(0, path)
from modeling_fontid import FontIDModel
model = FontIDModel.from_pretrained(path).eval()
proc = AutoProcessor.from_pretrained("google/siglip2-base-patch16-naflex")
maps = json.load(open(f"{path}/class_mappings.json"))
img = Image.open("crop.png").convert("RGB")
o = proc(images=img, max_num_patches=256, return_tensors="pt")
with torch.no_grad():
out = model(o["pixel_values"], o["pixel_attention_mask"], o["spatial_shapes"])
for head in ["font", "lang", "color", "style"]:
idx = int(out[head].argmax(-1))
print(head, maps[head][str(idx)])
Citation
Paper is coming soon.
Runs of issai FontID on huggingface.co
35
Total runs
3
24-hour runs
3
3-day runs
6
7-day runs
27
30-day runs
More Information About FontID huggingface.co Model
FontID huggingface.co is an AI model on huggingface.co that provides FontID's model effect (), which can be used instantly with this issai FontID model. huggingface.co supports a free trial of the FontID model, and also provides paid use of the FontID. Support call FontID model through api, including Node.js, Python, http.
FontID huggingface.co is an online trial and call api platform, which integrates FontID's modeling effects, including api services, and provides a free online trial of FontID, you can try FontID online for free by clicking the link below.
FontID is an open source model from GitHub that offers a free installation service, and any user can find FontID on GitHub to install. At the same time, huggingface.co provides the effect of FontID install, users can directly use FontID installed effect in huggingface.co for debugging and trial. It also supports api for free installation.