MCPcopy Index your code
hub / github.com/JiuhaiChen/CVPR2025-Florence-VL

github.com/JiuhaiChen/CVPR2025-Florence-VL @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
364 symbols 1,449 edges 67 files 31 documented · 9% updated 19mo ago★ 2458 open issues

Browse by type

Functions 312 Types & classes 41 Endpoints 11
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Florence-VL: Enhancing Vision-Language Models with Generative Vision Encoder and Depth-Breadth Fusion.

[Paper] [Project Page] [Demo 8B] [Checkpoint 8B]

Florence-VL Results

News

  • [2024-12-05] We release Arxiv paper, training code, checkpoint and Demo [3B, 8B]. 🤗 Have fun!

Install Environment

  1. Install package for tranining
conda create -n florence-vl python=3.11 -y
conda activate florence-vl
pip install --upgrade pip  
pip install -e .
pip install -e ".[train]"
pip install flash-attn --no-build-isolation
  1. Install package for evaluation (We use lmms-eval for evaluation.)
cd lmms-eval
pip install -e .

Dataset Download

  1. Pretrain Data:

Detailed Caption from PixelProse and ShareGPT4V.

  1. Instruction Data:

TODO.

Training Script

Training with llama 3.1-8B (phi-3 is similar)

Set up your basic slurm information in the scripts/florence-vl/llama/llama3.sh Then you can run pretrain and finetune job:

In scripts/florence-vl/llama/pretrain_llama.sh, you need to manully export the following variable:

export NNODES=number of nodes

export DATA_PATH=/your/path/for/pretrain/data/json/file
export IMG=/your/image/folder

export OUTPUT=/checkpoint/save/path

In scripts/florence-vl/llama/finetune_llama.sh, you need to manully export the following variable:

export NNODES=number of nodes

export DATA_PATH=/your/path/for/instuction/data/json/file
export IMG=/your/image/folder

export CKPT_PATH=/pretrain/checkpoint
export VIT_PATH=/pretrain/checkpoint/vision_tower
export OUTPUT=/checkpoint/save/path

Evaluation Script

We use lmms-eval for evaluation.

export OPENAI_API_KEY=your key
python -m accelerate.commands.launch \
    --num_processes=4 \
    -m lmms_eval \
    --model llava \
    --model_args pretrained="/your/model/path/,conv_template=/choose/from/llama3/or/phi" \
    --tasks  textvqa_val,gqa,realworldqa,vizwiz_vqa_val,pope,scienceqa_img,mmvet,mme,seedbench,hallusion_bench_image,llava_in_the_wild,mathvista_testmini,docvqa_val,ocrbench,chartqa,ai2d,mmmu_val,mmbench_en_dev,infovqa_val,mmbench_cn_dev,mmstar \
    --batch_size 1 \
    --log_samples \
    --log_samples_suffix florence-vl \
    --output_path ./logs/

Checkpoint

  1. Florence-VL 8B: Pretrained Checkpoint and Instructed Checkpoint.
  2. Florence-VL 3B: Pretrained Checkpoint and Instructed Checkpoint.

Acknowledgement

LLaVA: We start from codebase from the amazing LLaVA.

lmms-eval: Thanks for amazing multimodal evaluation codebase.

Core symbols most depended-on inside this repo

Shape

Function 175
Method 137
Class 41
Route 11

Languages

Python97%
TypeScript3%

Modules by API surface

llava/train/train.py38 symbols
llava/serve/controller.py30 symbols
llava/eval/m4c_evaluator.py20 symbols
llava/serve/sglang_worker.py15 symbols
llava/mm_utils.py15 symbols
llava/train/llava_trainer.py14 symbols
llava/serve/model_worker.py14 symbols
llava/serve/gradio_web_server.py13 symbols
llava/model/llava_arch.py13 symbols
scripts/convert_sqa_to_llava_base_prompt.py12 symbols
llava/model/multimodal_encoder/clip_encoder.py12 symbols
llava/model/multimodal_projector/builder.py11 symbols

For agents

$ claude mcp add CVPR2025-Florence-VL \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page