Mindket

Florence-2-base

Newversion 1 · updated

Overview

A small Microsoft vision model that handles captioning, object detection and segmentation by changing the text prompt. It suits developers and researchers who need several image tasks from one model.

Florence-2-base is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page, a zip of its files. Nothing in it runs by itself.

At a glance

You need
  • Python with pip
  • The transformers library and PyTorch
  • Pillow, to open your own image
Runs in
  • Python with the transformers library
  • A CUDA GPU or a plain CPU
  • Windows, macOS or Linux with Python
Start with
pip install -U huggingface_hub
hf download microsoft/Florence-2-base

Platform

WindowsOperating system
macOSOperating system
LinuxOperating system

About

What it is

Florence-2-base is the 232 million parameter version of Microsoft's Florence-2 vision model, packaged for the transformers library. One model covers several image jobs, and you choose the job with a short task prompt, such as captioning, object detection or segmentation. It was trained on FLD-5B, a set with 5.4 billion annotations over 126 million images, and it works zero-shot or after fine-tuning.

Who it suits

It suits developers and researchers who want one compact vision model for several tasks instead of a separate model for each. It runs on a CPU or a CUDA GPU.

Who might use it
IndustryWho uses itHow they use itExample
AccessibilityApp developersDraft written descriptions of imagesAsk for a detailed caption of a photo
Computer visionVision engineersFind objects in a picture with a promptRun the object detection prompt on a street scene
ResearchMachine learning researchersFine-tune a small base model on their own imagesStart from the base size and adapt it to a new task

If you need the strongest accuracy, you can skip the base size. The card also lists a larger 0.77 billion version.

Where to use it

The card shows it in Python through the transformers library, on a GPU when one is present and the CPU otherwise.

  • Python with the transformers library
  • A CUDA GPU or a plain CPU
  • Windows, macOS or Linux with Python
Jobs it does
Use caseWhoWhat they get back
Image captioningDevelopersA short, detailed or more detailed caption
Object detectionVision engineersDetected objects with their boxes
Segmentation and moreResearchersResults for other tasks chosen by the prompt

How to set it up

You need Python with pip, the transformers library, PyTorch and Pillow. Download the model files, then load them in your script.

  • Python with pip
  • The transformers library and PyTorch
  • Pillow, to open your own image
  1. Install the Hugging Face download tool.
  2. Download the model files.
  3. Load the model and processor in Python.
pip install -U huggingface_hub
hf download microsoft/Florence-2-base

How to use it

Load the model and processor, open an image with Pillow as the variable named image, pick a task prompt and generate. The card's own sample downloads a car photo from the web, which is left out here. The model works in float16 on a GPU.

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>"
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)

The card then defines a helper called run_example and swaps the prompt to change the task. These are the caption prompts it shows.

prompt = "<CAPTION>"
run_example(prompt)
prompt = "<DETAILED_CAPTION>"
run_example(prompt)
prompt = "<MORE_DETAILED_CAPTION>"
run_example(prompt)

Example

You open a photo of a street, set the object detection prompt and run the script. You get back parsed objects with their positions. Switching to the detailed caption prompt returns a written description of the same photo.

For newcomers and experts

If you are new, think of it as one model you steer with a short instruction. Start with the caption prompt on a photo you know, and read the text it returns.

If you know the field, it is a sequence-to-sequence model that turns every task into text, so one set of weights serves many tasks. The card lists four sizes, two pretrained and two fine-tuned. The sample sets trust_remote_code, so check that setting against your security rules.

  1. An image and a task prompt go in
  2. The processor prepares the inputs
  3. The model generates text
  4. The result is parsed into the task output

Good to know

The family comes in two sizes, each pretrained on FLD-5B or fine-tuned on downstream tasks.

Model size in billions of parameters
Florence-2-base0.23
Florence-2-large0.77
Florence-2-base-ft0.23
Florence-2-large-ft0.77
  • License: MIT
  • Cost to run: none named
  • Data it reaches: the model files from Hugging Face, and the images you load
  • Not for: work that needs the larger 0.77 billion model's capacity

README and files

README

Florence-2-base

A small Microsoft vision model that handles captioning, object detection and segmentation by changing the text prompt. It suits developers and researchers who need several image tasks from one model.

Made by microsoft on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.

About

What it is: Florence-2-base is the 232 million parameter version of Microsoft's Florence-2 vision model, packaged for the transformers library. One model covers several image jobs, and you choose the job with a short task prompt, such as captioning, object detection or segmentation. It was trained on FLD-5B, a set with 5.4 billion annotations over 126 million images, and it works zero-shot or after fine-tuning.

Who it suits: It suits developers and researchers who want one compact vision model for several tasks instead of a separate model for each. It runs on a CPU or a CUDA GPU.

Title: Who might use it
Industry | Who uses it | How they use it | Example
Accessibility | App developers | Draft written descriptions of images | Ask for a detailed caption of a photo
Computer vision | Vision engineers | Find objects in a picture with a prompt | Run the object detection prompt on a street scene
Research | Machine learning researchers | Fine-tune a small base model on their own images | Start from the base size and adapt it to a new task

If you need the strongest accuracy, you can skip the base size. The card also lists a larger 0.77 billion version.

Where to use it: The card shows it in Python through the transformers library, on a GPU when one is present and the CPU otherwise.

  • Python with the transformers library
  • A CUDA GPU or a plain CPU
  • Windows, macOS or Linux with Python
Title: Jobs it does
Use case | Who | What they get back
Image captioning | Developers | A short, detailed or more detailed caption
Object detection | Vision engineers | Detected objects with their boxes
Segmentation and more | Researchers | Results for other tasks chosen by the prompt

How to set it up: You need Python with pip, the transformers library, PyTorch and Pillow. Download the model files, then load them in your script.

  • Python with pip
  • The transformers library and PyTorch
  • Pillow, to open your own image
  1. Install the Hugging Face download tool.
  2. Download the model files.
  3. Load the model and processor in Python.
pip install -U huggingface_hub
hf download microsoft/Florence-2-base

How to use it: Load the model and processor, open an image with Pillow as the variable named image, pick a task prompt and generate. The card's own sample downloads a car photo from the web, which is left out here. The model works in float16 on a GPU.

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>"
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)

The card then defines a helper called run_example and swaps the prompt to change the task. These are the caption prompts it shows.

prompt = "<CAPTION>"
run_example(prompt)
prompt = "<DETAILED_CAPTION>"
run_example(prompt)
prompt = "<MORE_DETAILED_CAPTION>"
run_example(prompt)

Example: You open a photo of a street, set the object detection prompt and run the script. You get back parsed objects with their positions. Switching to the detailed caption prompt returns a written description of the same photo.

For newcomers and experts: If you are new, think of it as one model you steer with a short instruction. Start with the caption prompt on a photo you know, and read the text it returns.

If you know the field, it is a sequence-to-sequence model that turns every task into text, so one set of weights serves many tasks. The card lists four sizes, two pretrained and two fine-tuned. The sample sets trust_remote_code, so check that setting against your security rules.

An image and a task prompt go in
The processor prepares the inputs
The model generates text
The result is parsed into the task output

Good to know: The family comes in two sizes, each pretrained on FLD-5B or fine-tuned on downstream tasks.

Title: Model size in billions of parameters
Florence-2-base: 0.23
Florence-2-large: 0.77
Florence-2-base-ft: 0.23
Florence-2-large-ft: 0.77
  • License: MIT
  • Cost to run: none named
  • Data it reaches: the model files from Hugging Face, and the images you load
  • Not for: work that needs the larger 0.77 billion model's capacity

On Hugging Face, 13 November 2026

  • Task: image text to text
  • Library: transformers
  • Parameters: 232M
  • Weights: about 463 MB in F16; about 116 MB at 4-bit (estimate)
  • Formats: Safetensors
  • Downloads in the last 30 days: 14,139,837
  • Likes: 439
  • License: mit
  • Quantized versions: 6
  • Fine-tunes: 21
  • Tags: transformers, pytorch, safetensors, florence2, image-text-to-text, vision

Links

Get the model

Download its files with Hugging Face's command line:

pip install -U huggingface_hub
hf download microsoft/Florence-2-base

Then follow the usage in its model card. Nothing in this kit runs by itself.

Files
README.md  6 KB

1 file, 6 KB, downloaded as a zip.

What’s new

  • Version 1 · 2026-11-13

Compare with similar

Listed Hugging Face models in the same category that share the most tags with this one.

ProductDownloads, last 30 daysLikesParametersLicenseLast change
Florence-2-base This page14,139,837439232Mmit
Florence-2-largeShares florence2 · vision · pytorch403,1131,889777Mmit
elephant-1Shares vision · image-text-to-text · transformers7,4261159.4Bmit
Agents-A1Shares vision · image-text-to-text · transformers7,23266935.1Bapache-2.0
mammoth-1Shares vision · image-text-to-text · transformers5,9039727.4Bmit
Qwen3.8-27B-piShares vision · image-text-to-text · transformers1,8578727.8Bapache-2.0
Numbers as Mindket last read them, from 2026-11-12 to 2026-11-13.

Reviews

No ratings yet

Write a review

No reviews yet.

What people say

Posts and comments that name this project on Hacker News, Bluesky, X, Reddit, Facebook and YouTube, found by a weekly search and on Trendshift. Mindket doesn’t write or check them. Open one to read it where it was posted.

Searched

More from Mindket

See all from Mindket

Nanosaur2-670M

well9472 · Kit

Makes illustrations from text prompts with a small 670M-parameter diffusion model, run through ComfyUI. Built as a low-budget research model for people who wan…

New

Reads handwritten Arabic text from images and returns it as text. A fine-tuned PaddleOCR-VL model for people digitizing Arabic handwriting.

New

Makes video clips from a text prompt or an image plus text, at up to 720P and 24 frames per second, in the Diffusers format for a single consumer GPU.

New

Similar in Developer

See all in Developer

Wan2.2-S2V-14B

Wan-AI · Kit

Generates cinematic video of a character driven by an audio track, and can also lip-sync existing video. For video creators, animators and researchers with a l…

New

Wan2.2-Animate-14B

Wan-AI · Kit

Animates a character or swaps one into a video by copying a performer's movement and expressions, as one model from the Wan2.2 video family. Use only faces and…

New

d3-turbo

vllm-sr · Kit

Answers choice, yes-or-no, score, box and tracking questions about text, images or video in one call, with a probability for each answer. For people building r…

New