Image-Text-to-Text
Transformers
Safetensors
English
Chinese
groundinganything_vlm
text-generation
visual-grounding
object-detection
referring-expression-comprehension
pointing
ocr
document-layout
custom-code
conversational
custom_code
Instructions to use GroundingPI/GroundAnything-VLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GroundingPI/GroundAnything-VLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="GroundingPI/GroundAnything-VLM", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("GroundingPI/GroundAnything-VLM", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use GroundingPI/GroundAnything-VLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GroundingPI/GroundAnything-VLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GroundingPI/GroundAnything-VLM", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/GroundingPI/GroundAnything-VLM
- SGLang
How to use GroundingPI/GroundAnything-VLM with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "GroundingPI/GroundAnything-VLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GroundingPI/GroundAnything-VLM", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "GroundingPI/GroundAnything-VLM" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GroundingPI/GroundAnything-VLM", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use GroundingPI/GroundAnything-VLM with Docker Model Runner:
docker model run hf.co/GroundingPI/GroundAnything-VLM
Document architecture, inference, evaluation, and paper results
Browse files- README.md +6 -6
- checksums.sha256 +1 -1
README.md
CHANGED
|
@@ -16,7 +16,7 @@ tags:
|
|
| 16 |
inference: false
|
| 17 |
---
|
| 18 |
|
| 19 |
-
<p align="center"><img src="assets/logo.png" width="150" alt="GroundAnything logo" /></p>
|
| 20 |
|
| 21 |
# GroundAnything-VLM: Reconciling Parallel Decoding with Precise Visual Grounding at Flash Speed
|
| 22 |
|
|
@@ -24,7 +24,7 @@ inference: false
|
|
| 24 |
|
| 25 |
**This repository contains the autoregressive GroundAnything-VLM checkpoint.** The family overview and figures below are shared with the DLM page; use the VLM serving recipe for these weights.
|
| 26 |
|
| 27 |
-
<p align="center"><img src="assets/fig1-teaser.png" width="100%" alt="GroundAnything Figure 1: broad visual grounding and parallel visual evidence extraction" /></p>
|
| 28 |
|
| 29 |
## 🔗 Quick Links
|
| 30 |
|
|
@@ -103,11 +103,11 @@ Global.
|
|
| 103 |
- **Spatial vocabulary:** 1,000 coordinate tokens shared with semantic labels and protocol markers.
|
| 104 |
- **DLM conversion:** the shared decoder and vocabulary head support both causal prediction and bidirectional response-block denoising. A mask token is added for diffusion generation.
|
| 105 |
|
| 106 |
-
<p align="center"><img src="assets/fig2-architecture.png" width="100%" alt="GroundAnything Figure 2: vision-language architecture and autoregressive-to-diffusion conversion" /></p>
|
| 107 |
|
| 108 |
*Figure 2. Shared model architecture and the conversion to parallel grounding.*
|
| 109 |
|
| 110 |
-
<p align="center"><img src="assets/fig4-attention-mask.png" width="640" alt="GroundAnything Figure 4: clean-stream causal and noisy-response block attention" /></p>
|
| 111 |
|
| 112 |
*Figure 4. The attention mask used during diffusion conversion. The clean stream uses causal attention. A noisy response block attends bidirectionally within its block and reads the clean conditioning context and strictly preceding clean response blocks. Conversion uses B=32; the illustration uses two-token blocks.*
|
| 113 |
|
|
@@ -190,7 +190,7 @@ External baseline weights and model services are separate from the evaluation to
|
|
| 190 |
|
| 191 |
## Quantitative Evaluation Benchmarks
|
| 192 |
|
| 193 |
-
<p align="center"><img src="assets/fig7-grounding-performance.png" width="100%" alt="GroundAnything Figure 7: GroundAnything and GroundAnything-VLM benchmark overview" /></p>
|
| 194 |
|
| 195 |
*Figure 7. Paper-reported capability overview. Detailed task-level scores, baseline settings, and evaluation protocols are provided in the paper and supplementary material.*
|
| 196 |
|
|
@@ -297,7 +297,7 @@ After a block is complete, a causal forward reconstructs its authoritative KV ca
|
|
| 297 |
|
| 298 |
The model uses its own shared weights to draft tokens with bidirectional attention and verify them with causal attention. Verification accepts the **longest consecutive matching prefix**, stops at the first mismatch, applies the causal correction, and discards the rejected suffix cache states. The shipped speculative route uses greedy verification; it is not a general stochastic speculative sampler.
|
| 299 |
|
| 300 |
-
<p align="center"><img src="assets/fig6-self-speculative-decoding.png" width="100%" alt="GroundAnything Figure 6: linear and quadratic self-speculative schedules with shared model weights" /></p>
|
| 301 |
|
| 302 |
*Figure 6. The paper studies two schedules: linear drafting and verification use two model forwards and 2B query tokens per round; quadratic fusion uses one forward after initialization with B(B + 1) query tokens. These counts describe queries and model calls, not total Transformer FLOPs.*
|
| 303 |
|
|
|
|
| 16 |
inference: false
|
| 17 |
---
|
| 18 |
|
| 19 |
+
<p align="center"><img src="https://huggingface.co/GroundingPI/GroundAnything-VLM/resolve/c367acf62cc8255782e3d19bd8c312f9b7ab35db/assets/logo.png" width="150" alt="GroundAnything logo" /></p>
|
| 20 |
|
| 21 |
# GroundAnything-VLM: Reconciling Parallel Decoding with Precise Visual Grounding at Flash Speed
|
| 22 |
|
|
|
|
| 24 |
|
| 25 |
**This repository contains the autoregressive GroundAnything-VLM checkpoint.** The family overview and figures below are shared with the DLM page; use the VLM serving recipe for these weights.
|
| 26 |
|
| 27 |
+
<p align="center"><img src="https://huggingface.co/GroundingPI/GroundAnything-VLM/resolve/c367acf62cc8255782e3d19bd8c312f9b7ab35db/assets/fig1-teaser.png" width="100%" alt="GroundAnything Figure 1: broad visual grounding and parallel visual evidence extraction" /></p>
|
| 28 |
|
| 29 |
## 🔗 Quick Links
|
| 30 |
|
|
|
|
| 103 |
- **Spatial vocabulary:** 1,000 coordinate tokens shared with semantic labels and protocol markers.
|
| 104 |
- **DLM conversion:** the shared decoder and vocabulary head support both causal prediction and bidirectional response-block denoising. A mask token is added for diffusion generation.
|
| 105 |
|
| 106 |
+
<p align="center"><img src="https://huggingface.co/GroundingPI/GroundAnything-VLM/resolve/c367acf62cc8255782e3d19bd8c312f9b7ab35db/assets/fig2-architecture.png" width="100%" alt="GroundAnything Figure 2: vision-language architecture and autoregressive-to-diffusion conversion" /></p>
|
| 107 |
|
| 108 |
*Figure 2. Shared model architecture and the conversion to parallel grounding.*
|
| 109 |
|
| 110 |
+
<p align="center"><img src="https://huggingface.co/GroundingPI/GroundAnything-VLM/resolve/c367acf62cc8255782e3d19bd8c312f9b7ab35db/assets/fig4-attention-mask.png" width="640" alt="GroundAnything Figure 4: clean-stream causal and noisy-response block attention" /></p>
|
| 111 |
|
| 112 |
*Figure 4. The attention mask used during diffusion conversion. The clean stream uses causal attention. A noisy response block attends bidirectionally within its block and reads the clean conditioning context and strictly preceding clean response blocks. Conversion uses B=32; the illustration uses two-token blocks.*
|
| 113 |
|
|
|
|
| 190 |
|
| 191 |
## Quantitative Evaluation Benchmarks
|
| 192 |
|
| 193 |
+
<p align="center"><img src="https://huggingface.co/GroundingPI/GroundAnything-VLM/resolve/c367acf62cc8255782e3d19bd8c312f9b7ab35db/assets/fig7-grounding-performance.png" width="100%" alt="GroundAnything Figure 7: GroundAnything and GroundAnything-VLM benchmark overview" /></p>
|
| 194 |
|
| 195 |
*Figure 7. Paper-reported capability overview. Detailed task-level scores, baseline settings, and evaluation protocols are provided in the paper and supplementary material.*
|
| 196 |
|
|
|
|
| 297 |
|
| 298 |
The model uses its own shared weights to draft tokens with bidirectional attention and verify them with causal attention. Verification accepts the **longest consecutive matching prefix**, stops at the first mismatch, applies the causal correction, and discards the rejected suffix cache states. The shipped speculative route uses greedy verification; it is not a general stochastic speculative sampler.
|
| 299 |
|
| 300 |
+
<p align="center"><img src="https://huggingface.co/GroundingPI/GroundAnything-VLM/resolve/c367acf62cc8255782e3d19bd8c312f9b7ab35db/assets/fig6-self-speculative-decoding.png" width="100%" alt="GroundAnything Figure 6: linear and quadratic self-speculative schedules with shared model weights" /></p>
|
| 301 |
|
| 302 |
*Figure 6. The paper studies two schedules: linear drafting and verification use two model forwards and 2B query tokens per round; quadratic fusion uses one forward after initialization with B(B + 1) query tokens. These counts describe queries and model calls, not total Transformer FLOPs.*
|
| 303 |
|
checksums.sha256
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
20c797ce19af0c17de52c6afb144644768a591c521655f5ebf5712c9850f2887 LICENSE
|
| 2 |
-
|
| 3 |
7316e325dde0dd407bcc80ed5d3d080223e54572a4685b2aa1ee52041e41d466 added_tokens.json
|
| 4 |
a0bc6f6fc7a29a80017a433e8f03a1cc1236e838a944a2d034295a60c4f2fddb chat_template.jinja
|
| 5 |
2a23a7cf76128488c8866582bab06ffb1db387f7f7de82e06fafea65514ce10d config.json
|
|
|
|
| 1 |
20c797ce19af0c17de52c6afb144644768a591c521655f5ebf5712c9850f2887 LICENSE
|
| 2 |
+
94a9cd2753a1eca3a19566727433f7d3aa72050e2b4eeb0b25b3280ea82e9f83 README.md
|
| 3 |
7316e325dde0dd407bcc80ed5d3d080223e54572a4685b2aa1ee52041e41d466 added_tokens.json
|
| 4 |
a0bc6f6fc7a29a80017a433e8f03a1cc1236e838a944a2d034295a60c4f2fddb chat_template.jinja
|
| 5 |
2a23a7cf76128488c8866582bab06ffb1db387f7f7de82e06fafea65514ce10d config.json
|