alt.freeweights.text / Florence-2-base
From: microsoft <huggingface.co/microsoft>Newsgroups: alt.freeweights.textSubject:

Florence-2-base

Date: 2026-11-15Commit: 5ca5edfSigned: 2DC28CC7B26A283B ✓

Image text to text model with 232M parameters. Safetensors weights, 930 MB in all. Published by microsoft under MIT.

232M params930MBFlorence-2-basesafetensorspermissive
FactsParams232MSize930 MBFormatssafetensorsTaskimage text to textLicenseMITFrom sourcepermissive
$ fw get microsoft/Florence-2-base
# manifest sha256 77742c6f0a3d… · 930 MB · 16 files
$ fw verify ./Florence-2-base microsoft/Florence-2-base
From sourceHosted (signed)microsoft/Florence-2-baseLast check: 2026-11-15 02:25 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Runs withAIBrixBentoMLCTranslate2ExLlamaV2ExLlamaV3exofastllmFlashInferKTransformersLitServeLMCacheLMDeployLocalAImistral.rsMLC LLMMooncakeSGLangText Generation WebUItinygradTransformersTriton Inference ServervLLMXinferenceFine-tune withAccelerateAlignment HandbookAxolotlColossal-AIDeepSpeedEasyR1FlashAttentionH2O LLM StudioJAXKerasLiger KernelLitGPTLLaMA-FactoryMegatron-LMms-swiftnanotronOLMo-coreOpenRLHFOumiPEFTPyTorch Lightningsd-scriptsSimpleTunerTorchTitantorchtuneTransformer EngineTRLUnslothverlConvert withAQLMAutoRoundCore ML ToolsExecuTorchGPTQModelLLM CompressormergekitNeural CompressorOliveONNXOptimum QuantoOptimumsafetensorsTensorRT Model OptimizertorchaoEvaluate withAutoevalsDeepEvalEvaluateHELMLightEvallm-evaluation-harnessOpenCompassOpikRagassimple-evalsSWE-benchTruLensWeaveScan withAgentDojoAI Fairness 360DeepTeamDetoxifyFairlearngarakGiskardGuardrailsMCP ScannerModelScanNeMo GuardrailspicklescanpromptfooWorks withAgent Development KitAG2Google AI Edge GalleryAiderany-llmAnythingLLMBAMLbrowser-useCAMELHugging Face Chat UIChatboxCherry StudioClineCodex CLICogneeCrewAIDeerFlowdocTRDSPyEasyOCREnchantedGemini CLIGitHub MCP ServergooseGPT ResearcherGradioGraphitiGuidanceHollamaInstructorKilo CodeLangflowLangGraphLiteLLMLlamaIndexLLMLocalAGILoLLMs WebUIMCP Python SDKMem0MetaGPTNextChatOllama JavaScriptOllama PythonolmOCROpenAI Agents SDKopencodeOpenHandsotermOutlinesPage AssistPlaywright MCPPortkey AI GatewayPrivateGPTQwen CodeRWKV RunnerSemantic KernelsmolagentsStrands AgentsSuryaVaneXGrammar

Overview

Size
930 MB
Weights
463 MB (safetensors)
Parameters
232M
Formats
safetensors
Task
image text to text
License
MIT (permissive)
Files
16, each with a sha256
Publisher
microsoft
Added
2026-11-15
Section
alt.freeweights.text
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 02:25 UTCpassed

Model card

From the publisher at commit 5ca5edf. Shown as plain text with links; images open at the publisher.

Florence-2: Advancing a Unified Representation for a Variety of Vision Tasks#

Model Summary#

This Hub repository contains a HuggingFace's transformers implementation of Florence-2 model from Microsoft.

Florence-2 is an advanced vision foundation model that uses a prompt-based approach to handle a wide range of vision and vision-language tasks. Florence-2 can interpret simple text prompts to perform tasks like captioning, object detection, and segmentation. It leverages our FLD-5B dataset, containing 5.4 billion annotations across 126 million images, to master multi-task learning. The model's sequence-to-sequence architecture enables it to excel in both zero-shot and fine-tuned settings, proving to be a competitive vision foundation model.

Resources and Technical Documentation:

ModelModel sizeModel Description
Florence-2-base[[HF]](https://huggingface.co/microsoft/Florence-2-base)0.23BPretrained model with FLD-5B
Florence-2-large[[HF]](https://huggingface.co/microsoft/Florence-2-large)0.77BPretrained model with FLD-5B
Florence-2-base-ft[[HF]](https://huggingface.co/microsoft/Florence-2-base-ft)0.23BFinetuned model on a colletion of downstream tasks
Florence-2-large-ft[[HF]](https://huggingface.co/microsoft/Florence-2-large-ft)0.77BFinetuned model on a colletion of downstream tasks

How to Get Started with the Model#

Use the code below to get started with the model. All models are trained with float16.

import requests

from PIL import Image
from transformers import AutoProcessor, AutoModelForCausalLM 

device = "cuda:0" if torch.cuda.is_available() else "cpu"
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32

model = AutoModelForCausalLM.from_pretrained("microsoft/Florence-2-base", torch_dtype=torch_dtype, trust_remote_code=True).to(device)
processor = AutoProcessor.from_pretrained("microsoft/Florence-2-base", trust_remote_code=True)

prompt = "<OD>"

url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg?download=true"
image = Image.open(requests.get(url, stream=True).raw)

inputs = processor(text=prompt, images=image, return_tensors="pt").to(device, torch_dtype)

generated_ids = model.generate(
    input_ids=inputs["input_ids"],
    pixel_values=inputs["pixel_values"],
    max_new_tokens=1024,
    do_sample=False,
    num_beams=3,
)
generated_text = processor.batch_decode(generated_ids, skip_special_tokens=False)[0]

parsed_answer = processor.post_process_generation(generated_text, task="<OD>", image_size=(image.width, image.height))

print(parsed_answer)

Tasks#

This model is capable of performing different tasks through changing the prompts.

First, let's define a function to run a prompt.

Click to expand

import requests

from PIL import Image
from transformers import AutoProcessor, AutoModelForCausalLM 

device = "cuda:0" if torch.cuda.is_available() else "cpu"
torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32

model = AutoModelForCausalLM.from_pretrained("microsoft/Florence-2-base", torch_dtype=torch_dtype, trust_remote_code=True).to(device)
processor = AutoProcessor.from_pretrained("microsoft/Florence-2-base", trust_remote_code=True)

url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/car.jpg?download=true"
image = Image.open(requests.get(url, stream=True).raw)

def run_example(task_prompt, text_input=None):
    if text_input is None:
        prompt = task_prompt
    else:
        prompt = task_prompt + text_input
    inputs = processor(text=prompt, images=image, return_tensors="pt").to(device, torch_dtype)
    generated_ids = model.generate(
      input_ids=inputs["input_ids"],
      pixel_values=inputs["pixel_values"],
      max_new_tokens=1024,
      num_beams=3
    )
    generated_text = processor.batch_decode(generated_ids, skip_special_tokens=False)[0]

    parsed_answer = processor.post_process_generation(generated_text, task=task_prompt, image_size=(image.width, image.height))

    print(parsed_answer)

Here are the tasks Florence-2 could perform:

Click to expand

Caption#
prompt = "<CAPTION>"
run_example(prompt)
Detailed Caption#
prompt = "<DETAILED_CAPTION>"
run_example(prompt)
More Detailed Caption#
prompt = "<MORE_DETAILED_CAPTION>"
run_example(prompt)
Caption to Phrase Grounding#

caption to phrase grounding task requires additional text input, i.e. caption.

Caption to phrase grounding results format: {'\<CAPTION_TO_PHRASE_GROUNDING>': {'bboxes': [[x1, y1, x2, y2], ...], 'labels': ['', '', ...]}}

task_prompt = "<CAPTION_TO_PHRASE_GROUNDING>"
results = run_example(task_prompt, text_input="A green car parked in front of a yellow building.")
Object Detection#

OD results format: {'\': {'bboxes': [[x1, y1, x2, y2], ...], 'labels': ['label1', 'label2', ...]} }

prompt = "<OD>"
run_example(prompt)
Dense Region Caption#

Dense region caption results format: {'\<DENSE_REGION_CAPTION>' : {'bboxes': [[x1, y1, x2, y2], ...], 'labels': ['label1', 'label2', ...]} }

prompt = "<DENSE_REGION_CAPTION>"
run_example(prompt)
Region proposal#

Dense region caption results format: {'\<REGION_PROPOSAL>': {'bboxes': [[x1, y1, x2, y2], ...], 'labels': ['', '', ...]}}

prompt = "<REGION_PROPOSAL>"
run_example(prompt)
OCR#
prompt = "<OCR>"
run_example(prompt)
OCR with Region#

OCR with region output format: {'\<OCR_WITH_REGION>': {'quad_boxes': [[x1, y1, x2, y2, x3, y3, x4, y4], ...], 'labels': ['text1', ...]}}

prompt = "<OCR_WITH_REGION>"
run_example(prompt)

for More detailed examples, please refer to notebook

Benchmarks#

Florence-2 Zero-shot performance#

The following table presents the zero-shot performance of generalist vision foundation models on image captioning and object detection evaluation tasks. These models have not been exposed to the training data of the evaluation tasks during their training phase.

Method#paramsCOCO Cap. test CIDErNoCaps val CIDErTextCaps val CIDErCOCO Det. val2017 mAP
Flamingo80B84.3---
Florence-2-base0.23B133.0118.770.134.7
Florence-2-large0.77B135.6120.872.837.5

The following table continues the comparison with performance on other vision-language evaluation tasks.

MethodFlickr30k test R@1Refcoco val AccuracyRefcoco test-A AccuracyRefcoco test-B AccuracyRefcoco+ val AccuracyRefcoco+ test-A AccuracyRefcoco+ test-B AccuracyRefcocog val AccuracyRefcocog test AccuracyRefcoco RES val mIoU
Kosmos-278.752.357.447.345.550.742.260.661.7-
Florence-2-base83.653.958.449.751.556.447.966.365.134.6
Florence-2-large84.456.361.651.453.657.949.968.067.035.8

Florence-2 finetuned performance#

We finetune Florence-2 models with a collection of downstream tasks, resulting two generalist models Florence-2-base-ft and Florence-2-large-ft that can conduct a wide range of downstream tasks.

The table below compares the performance of specialist and generalist models on various captioning and Visual Question Answering (VQA) tasks. Specialist models are fine-tuned specifically for each task, whereas generalist models are fine-tuned in a task-agnostic manner across all tasks. The symbol "▲" indicates the usage of external OCR as input.

Method# ParamsCOCO Caption Karpathy test CIDErNoCaps val CIDErTextCaps val CIDErVQAv2 test-dev AccTextVQA test-dev AccVizWiz VQA test-dev Acc
Specialist Models
CoCa2.1B143.6122.4-82.3--
BLIP-27.8B144.5121.6-82.2--
GIT25.1B145.0126.9148.681.767.371.0
Flamingo80B138.1--82.054.165.7
PaLI17B149.1127.0160.0▲84.358.8 / 73.1▲71.6 / 74.4▲
PaLI-X55B149.2126.3147.0 / 163.7▲86.071.4 / 80.8▲70.9 / 74.6▲
Generalist Models
Unified-IO2.9B-100.0-77.9-57.4
Florence-2-base-ft0.23B140.0116.7143.979.763.663.6
Florence-2-large-ft0.77B143.3124.9151.181.773.572.6
Method# ParamsCOCO Det. val2017 mAPFlickr30k test R@1RefCOCO val AccuracyRefCOCO test-A AccuracyRefCOCO test-B AccuracyRefCOCO+ val AccuracyRefCOCO+ test-A AccuracyRefCOCO+ test-B AccuracyRefCOCOg val AccuracyRefCOCOg test AccuracyRefCOCO RES val mIoU
Specialist Models
SeqTR---83.786.581.271.576.364.974.974.2-
PolyFormer---90.492.987.285.089.878.085.885.976.9
UNINEXT0.74B60.6-92.694.391.585.289.679.888.789.4-
Ferret13B--89.592.484.482.888.175.285.886.3-
Generalist Models
UniTAB---88.691.183.881.085.471.684.684.7-
Florence-2-base-ft0.23B41.484.092.694.891.586.891.782.289.882.278.0
Florence-2-large-ft0.77B43.485.293.495.392.088.392.983.691.291.780.5

BibTex and citation info#

@article{xiao2023florence,
  title={Florence-2: Advancing a unified representation for a variety of vision tasks},
  author={Xiao, Bin and Wu, Haiping and Xu, Weijian and Dai, Xiyang and Hu, Houdong and Lu, Yumao and Zeng, Michael and Liu, Ce and Yuan, Lu},
  journal={arXiv preprint arXiv:2311.06242},
  year={2023}
}

Files

16 files · 930 MBWeights 463 MB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 16 files with their sha256
FileSizesha256
.gitattributes1.56 KB28aac17b0f70983ef58c18a7ee355503e454ce3178fce77a7b50503906df0635
CODE_OF_CONDUCT.md444 B9daeae709a0bd71bcfd1c96dc5822ecec5210327eff929da64b0ae7f8faf1444
LICENSE1.14 KBc2cfccb812fe482101a8f04597dfc5a9991a6b2748266c47ac91b6a5aae15383
README.md14.8 KBe49de5527bd39688745ce20388bf3f31fdb891abc0e6950a3f64630114769d17
SECURITY.md2.66 KB7b6976eec43edfa68b79a459dd089c56b7a395916dbf1a01bd11e6d86e12128f
SUPPORT.md1.24 KB149773411caf2c59cb1a6bfb2c6f070d1d054f1f018e7a80be319a8c384eeaf5
config.json2.43 KBc666d0fe0172d46e115e8fba6cd93cd83714575b33a73005cab8d24ce2a3aa8f
configuration_florence2.py15.1 KBde2e45a975b3582de05d2f4d963a3e9f9a3d20dccf78d28e0052932a0be93bdf
model.safetensors463 MB03075d2d2d2bbd3e180b9ba0afae4aa8563226e2d32911656966e05b2f2ee060
modeling_florence2.py127 KB5162bf465e61b6e29cc113a467630ec3cb56ed8e4d46eb6207157f10fb9b8a24
preprocessor_config.json806 B2f5921bbc53c7cc04251e1027b45b1cec726276be6db23d1bb40641bfbe2cf29
processing_florence2.py48.7 KBf146023a507c009f425a49ee39aa037f4f25c64e14336e3e4f3f1d7377a68e98
pytorch_model.bin464 MBb480ac374593b0dcb18ffa63b23213734e04cd43eab0d620d23e39708d4a4a7e
tokenizer.json1.36 MB847bbeab6174d66a88898f729d52fa8d355fafe1bea101cf960dd404581df70e
tokenizer_config.json34 B79ffcf43af8ebda99d165f61d243180da2e2639952e41e71e11611c18770489c
vocab.json1.10 MB394fdc63c71aabe0a9b97117f5d62fb5fcc4d59b2b3ea929a3929e6a53217b3c
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
5ca5edf5bd pinned now2026-11-15 02:25 UTC16 files · 930 MB

Use it

$ fw get microsoft/Florence-2-base
# manifest sha256 77742c6f0a3d… · 930 MB · 16 files
$ fw verify ./Florence-2-base microsoft/Florence-2-base
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/microsoft/Florence-2-base.json --dir ./Florence-2-base $ python3 fw.py verify ./Florence-2-base ./microsoft__Florence-2-base.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/Florence-2-base --revision 5ca5edf5bd017b9919c05d08aebef5e4c7ac3bac --local-dir ./Florence-2-base
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModelForImageTextToText, AutoProcessor processor = AutoProcessor.from_pretrained("microsoft/Florence-2-base", revision="5ca5edf5bd017b9919c05d08aebef5e4c7ac3bac") model = AutoModelForImageTextToText.from_pretrained("microsoft/Florence-2-base", revision="5ca5edf5bd017b9919c05d08aebef5e4c7ac3bac", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve microsoft/Florence-2-base --revision 5ca5edf5bd017b9919c05d08aebef5e4c7ac3bac

License

Name
MIT License
Id
MIT
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
LICENSE
Text sha256
c2cfccb812fe482101a8f04597dfc5a9991a6b2748266c47ac91b6a5aae15383
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: microsoft <huggingface.co/microsoft>Newsgroups: alt.freeweights.textSubject: Florence-2-baseDate: 2026-11-15Commit: 5ca5edfSigned: 2DC28CC7B26A283B ✓
Upstream
microsoft/Florence-2-base
Pinned commit
5ca5edf5bd017b9919c05d08aebef5e4c7ac3bac
Manifest
Florence-2-base.json · .minisig
Manifest sha256
77742c6f0a3db10ca7ad200fc8f1c52844d3c8a7f9c1ba391b0777f71d39656d
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 02:25 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/microsoft/Florence-2-base.json $ curl -O https://freeweights.allternit.com/manifests/microsoft/Florence-2-base.json.minisig $ minisign -Vm Florence-2-base.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

1 model in the catalog name this one as their parent.

Quantizations
1
Quantizations 1
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download microsoft/Florence-2-base
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. Florence-2-base.json. Provenance. Takedown history: none.

Variants

1 quantized or adapter build of Florence-2-base. Each has its own license check and page.

From: laion <huggingface.co/laion>Subject: a2-rl-e2egit_large-50-32B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-large-15-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-v2-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_pymethods2test-large-80-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_unitsyn-python-large-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_mix_h2_language_proportional-65-8B