Instructions to use zeromodels/locateanything_3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- KerasFormers
How to use zeromodels/locateanything_3b with KerasFormers:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Keras
How to use zeromodels/locateanything_3b with Keras:
# Available backend options are: "jax", "torch", "tensorflow". import os os.environ["KERAS_BACKEND"] = "jax" import keras model = keras.saving.load_model("hf://zeromodels/locateanything_3b") - Notebooks
- Google Colab
- Kaggle
See our collection for all versions of LocateAnything.
Run LocateAnything with Keras 3: JAX, PyTorch, or TensorFlow
kerasformers/locateanything_3b
Paper: LocateAnything: Fast and High-Quality Vision-Language Grounding with Parallel Box Decoding (arXiv:2605.27365) · HF Papers
LocateAnything is a vision-language grounding model for detection, referring, pointing, layout, GUI/text grounding, and OCR. Build the instruction with locate_prompt(task, text), then parse boxes / points / grounding from the generated token ids.
For more details on the model, please go to the upstream model card.
Pure-Keras 3 conversion of nvidia/LocateAnything-3B for kerasformers. One implementation runs unmodified on TensorFlow / Torch / JAX.
This is a grounding VLM checkpoint (LocateAnythingConditionalGenerate). Prefer load_dtype="bfloat16".
✨ Quick start (open-vocabulary detection)
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
import keras
import numpy as np
from PIL import Image
from kerasformers.models.locateanything import (
LocateAnythingConditionalGenerate,
LocateAnythingProcessor,
locate_prompt,
)
model = LocateAnythingConditionalGenerate.from_weights(
"kerasformers/locateanything_3b", load_dtype="bfloat16"
)
processor = LocateAnythingProcessor.from_weights("kerasformers/locateanything_3b")
image = Image.open("your_image.jpg").convert("RGB")
# Tasks: detection | referring | phrase_grounding | pointing |
# layout | text_grounding | OCR
prompt = locate_prompt("detection", "zebra")
inputs = processor(
conversation=[
{
"role": "user",
"content": [
{"type": "image", "image": image},
{"type": "text", "text": prompt},
],
}
]
)
out = model.generate(
**inputs, max_new_tokens=192, tokenizer=processor.tokenizer
)
ids = np.asarray(keras.ops.convert_to_numpy(out))[0].tolist()
boxes = processor.tokenizer.parse_boxes(ids) # [0, 1000] grid
print(len(boxes), boxes[:2])
Load any LocateAnything variant the same way with from_weights("kerasformers/<variant>"):
| Variant | Hub |
|---|---|
locateanything_3b |
kerasformers/locateanything_3b |
Tips
- Set
KERAS_BACKENDbefore importing Keras / kerasformers. - Use
parse_boxesfor detection,parse_pointsfor pointing,parse_groundingfor referring / layout / text / OCR. - Boxes and points are on a
[0, 1000]grid; scale to pixels yourself. - See LocateAnything docs and Loading Weights.
- Community / upstream safetensors still work via the
hf:prefix, e.g.LocateAnythingConditionalGenerate.from_weights("hf:nvidia/LocateAnything-3B").
Special Thanks
A huge thank you to the NVIDIA LocateAnything authors for creating and releasing these models.
License: NVIDIA License (non-commercial / research). See the upstream card for component licenses (Qwen2.5, MoonViT, etc.).
- Downloads last month
- 62