Downloads · 30 days
6
9% of all-time downloads
Heliosoph/florence-2-base-ft-fp16-onnx
florence-2-base-ft-fp16-onnx is a image-to-text model from Heliosoph. Use it when you need a caption or text from an image. It is set up for transformers. The card lists the license as mit.
ONNX export of microsoft/Florence-2-base-ft at fp16 precision. Florence-2 is Microsoft's unified vision-language model — a single checkpoint that handles captioning, OCR, object detection, region description, and grou…
Downloads · 30 days
6
9% of all-time downloads
All-time downloads
69
Public
Repo size
544 MB
Likes
0
Public
Click a slice to open those files.
.onnx544 MB · 99%
From the Hugging Face model README
ONNX export of microsoft/Florence-2-base-ft at fp16 precision. Florence-2 is Microsoft's unified vision-language model — a single checkpoint that handles captioning, OCR, object detection, region description, and grounded VQA via task-prompted decoding.
Converted artifact. Training credit: Microsoft Research.
Florence-2 ships as four ONNX files (one per sub-model). All four are required at inference:
config.json
generation_config.json
preprocessor_config.json
tokenizer.json
tokenizer_config.json
vocab.json
merges.txt
special_tokens_map.json
vision_encoder_fp16.onnx # DaViT image encoder
encoder_model_fp16.onnx # text encoder (T5-style)
decoder_model_fp16.onnx # autoregressive decoder
embed_tokens_fp16.onnx # token embedding lookup
Total: ~520 MB. Use with optimum.onnxruntime.ORTModelForVision2Seq or load the four sessions manually.
optimum-cli export onnx \
--model microsoft/Florence-2-base-ft \
--task image-to-text \
--dtype fp16 \
--trust-remote-code \
<output>
Toolchain: optimum 1.24.0, transformers 4.45.2, torch 2.4.x. --trust-remote-code is required — Florence-2 ships custom modeling code (modeling_florence2.py) in the source repo.
| Task | Prompt |
|---|---|
| Caption | <CAPTION> |
| Detailed caption | <DETAILED_CAPTION> |
| More detailed caption | <MORE_DETAILED_CAPTION> |
| OCR | <OCR> |
| OCR with regions | <OCR_WITH_REGION> |
| Object detection | <OD> |
| Dense region caption | <DENSE_REGION_CAPTION> |
| Region proposal | <REGION_PROPOSAL> |
| Caption to phrase grounding | <CAPTION_TO_PHRASE_GROUNDING> |
| Referring expression segmentation | <REFERRING_EXPRESSION_SEGMENTATION> |
Full task-prompt list: see the upstream model card.
This repo (fp16): GPU inference, maximum quality. ~520 MB.
Heliosoph/florence-2-base-ft-quantized-onnx: CPU / NPU / mobile, INT8 dynamic. ~270 MB, modestly degraded on text-heavy OCR.
MIT — same as upstream. LICENSE file included.