All models

Microsoft

Florence-2

About

Florence-2 is a 232M open-weight model from Microsoft. Vision foundation model for captioning, OCR, detection, and region tasks. It accepts text and images. License is MIT. Released June 15, 2024.

  • Parameters

    232M

    Published parameter count.

  • License

    MIT

    License on the weights.

Pricing

Token rates are US dollars per 1M tokens. Image rates are per 1K images. Audio rates are per 1M audio seconds.

RatePrice
Input / 1M$0.10
Cached input / 1M$0.03
Output / 1M$0.30

Compare

Florence-2 is one of the catalog's OCR models. The table is each model's published price, size, and context.

ModelWhat it doesPriceParametersContext
Florence-2Vision foundation model for captioning, OCR, detection, and region tasks.$0.10 / 1M input232M—
PP-OCRv6PaddleOCR PP-OCRv6 medium text detection and recognition; scene OCR JSONL on image chat; text returns plain text; document_url fan-out via text.$0.01 / 1M input20M—
DeepSeek-OCR-2DeepSeek OCR 2 and markdown extraction.$0.25 / 1M input3.4B32K
dots.mocrMultilingual document layout parsing and markdown OCR.$0.20 / 1M input3B32K

Benchmarks

Published scores for Florence-2, from the Florence-2 model card.

Evals
ReadingExample
QualitativeClear structure, grounded in the input
QuantitativeCOCO caption CIDEr: 140.
Cost and performanceLower listed rate, mid-pack latency

Examples

  • Wooden cutting board with vegetables and Florence-2 dense region captions overlaid

    Dense region captions

    Florence-2 names every region in a vegetables-on-counter shot.

    {"regions":[{"label":"a tomato","box_xyxy":[58,140,224,396]}, ...]}

  • Shadcn-style analytics dashboard captured for Florence-2 captioning

    Dashboard caption

    `more_detailed_caption` describes a shadcn dashboard screenshot.

    {"caption":"A modern analytics dashboard with KPI cards, ..."}

Methods

Methods this model serves. Payload shapes are in the docs.

MethodReturns
captionA short caption
detailed_captionA longer caption
more_detailed_captionA detailed caption
ocrLines of text
ocr_with_regionText with regions
odBoxes around objects
dense_region_captionA caption for each region
region_proposalRegion boxes

Estimate cost

$0.40

Quick start

Call this model on the OpenAI-compatible gateway. The model id is already filled in.

from openai import OpenAI

client = OpenAI(
    base_url="https://gateway.vlm.run/v1/openai",
    api_key="<VLMRUN_API_KEY>",
)

response = client.chat.completions.create(
    model="microsoft/florence-2-base-ft",
    messages=[{"role": "user", "content": "What is in this image?"}],
)

print(response.choices[0].message.content)

Get an API key. Ship vision today.