Skip to main content

LocateAnything Visual Grounding

Open-vocabulary visual grounding via a VLM β€” a single phrase finds / counts any object in a frame, no pre-trained categories. A GPU server is required.


1. Solution Overview​

locate-anything-v2 is an HTTP bridge extension: the extension is a lightweight client, while the LocateAnything-3B model runs in a separate Python inference service (NVIDIA GPU recommended). The extension handles result post-processing (NMS, area filtering).

"Open-vocabulary" is its core: unlike YOLO, which only recognizes its pre-trained 80 classes, you describe what to find in any natural language and the model locates it zero-shot.

Five commands:

CapabilityCommandKey parameterDescription
Category detectiondetectcategories (e.g. person,car)Detect by category
Phrase groundinggroundphrase (natural language)Zero-shot locate by description; single/multi
Text localizationdetect_textβ€”Locate all text in the frame
GUI groundingground_guiphrase, output_type (box/point)Locate UI elements in a screenshot
PointingpointphrasePoint to a specific object

Data Flow:


2. Bill of Materials (BOM)​

ItemSpecPurposeRequired
NeoMind platformv0.8.0+Extension hostβœ…
locate-anything-v2 extensionv2.7.7+HTTP bridge + post-processingβœ…
GPU inference serverNVIDIA GPURun the LocateAnything Python serviceβœ…
Local LLMOllama, etc.AI Chat backendOptional

3. Prerequisites: Deploy the Inference Service​

The LocateAnything extension is just an HTTP client; the actual nvidia/LocateAnything-3B model (~6 GB) runs in a separate Python inference service. Built on FastAPI, it exposes these endpoints:

EndpointMethodPurpose
/healthGETHealth check; returns model and device status
/detectPOSTDetect by category
/groundPOSTNatural-language phrase grounding
/detect_textPOSTLocalize all text in the frame
/ground_guiPOSTLocalize a UI element
/pointPOSTPoint at an object

It defaults to http://127.0.0.1:9380; the service source lives in the extension's service/ directory (server.py, locateanything_worker.py, Dockerfile, docker-compose.yml, start.sh). Two options: Docker (recommended) or local run.

The image is based on pytorch/pytorch:2.6.0-cuda12.4-cudnn9-devel and ships with the CUDA runtime.

Prerequisite: an NVIDIA GPU with the NVIDIA Container Toolkit installed.

cd service/

# Build the image (first build is slower; installs deps)
docker build -t locate-anything-service .

# Optional: pre-download the model (~6 GB) at build time to skip the first-start wait
docker build --build-arg DOWNLOAD_MODEL=1 -t locate-anything-service .

# Run: map port, mount model cache volume, attach GPU
docker run -d --gpus all \
-p 9380:9380 \
-v locate-models:/models \
locate-anything-service

Or use the included Compose file (equivalent, with auto-restart and a health check):

cd service/
docker compose up -d # start
docker compose logs -f # follow logs (first run downloads the model)

The model is ~6 GB, cached in the locate-models volume (at /models/huggingface inside the container); the first start downloads it, which is why the health check's start_period is 300 s.

3.2 Option 2: Run locally​

Good for dev/debug, or for running on a Mac (MPS) / a GPU workstation.

Prerequisite: Python 3.10+; install the CUDA build of PyTorch on NVIDIA GPUs, or use MPS on Mac.

cd service/

# Install deps (Mac/CPU-compatible; includes torch>=2.5)
pip install -r requirements.txt

# Use the start script (auto-detects the env, sets MPS fallback)
./start.sh # default port 9380, downloads the model
./start.sh --port 9381 # custom port
./start.sh --model /path/to/model # use a local model path

# Or run directly
python server.py --host 0.0.0.0 --port 9380

Common environment variables:

VariableDefaultDescription
LOCATE_ANYTHING_MODELnvidia/LocateAnything-3BHF model ID or local path
LOCATE_ANYTHING_PORT9380Listen port (read by start.sh)
PYTORCH_ENABLE_MPS_FALLBACK1 (start.sh)macOS MPS fallback toggle

The inference device is auto-selected as CUDA β†’ MPS β†’ CPU; CUDA is recommended for production.

3.3 Verify the service is ready​

On startup the model loads first (~6 GB, plus a first-time download β€” wait a few minutes). Once ready, confirm with /health:

curl http://127.0.0.1:9380/health
# {"status":"ok","model":"nvidia/LocateAnything-3B","device":"cuda"}

status: ok means the model is loaded; model_not_loaded means it is still loading or failed (check the service logs).

Back on the NeoMind extension detail page, run check_status to confirm the model is loaded.


4. Install and Configure the Extension​

Go to the Extensions page, install locate-anything-v2 from the marketplace, and in Configuration point service_url at the inference service (e.g. http://<gpu-server-ip>:9380).

ParameterDefaultDescription
service_urlhttp://127.0.0.1:9380LocateAnything service URL
generation_modeslowfast (MTP, fastest) / slow (NTP, most stable) / hybrid (fast + fallback)
max_new_tokens2048Max tokens per inference (128–8192)
nms_iou_threshold0.7NMS IoU threshold (lower = more aggressive filtering)
min_area_ratio0.0005Min box area as fraction of image (filters tiny boxes)
max_area_ratio0.98Max box area as fraction of image (filters huge boxes)

NMS and area filtering apply to detect / ground / ground_gui; detect_text and point are returned as-is. All three can be overridden per command via args.


5. Usage​

5.1 Test with the Dashboard card (LocateCard)​

The extension ships a frontend component, LocateCard β€” add it to the Dashboard to test visually, with no need to fill in raw command args:

  1. Upload an image (the component compresses it automatically).
  2. Switch mode at the top: Detect / Locate / OCR / UI / Point (maps to detect / ground / detect_text / ground_gui / point).
  3. Enter a query in the bottom input: categories for Detect (e.g. person,car), a natural-language phrase for Locate/UI/Point (e.g. people in red vests); OCR needs no input.
  4. Click run (or press Enter) β€” boxes / points overlay directly on the image, with elapsed time and count shown.

Under the hood it calls the same extension commands; the card just wraps image upload, parameters, and result visualization.

5.2 Integrate with the NE101 camera component​

In the NE101 camera component, set processingExtensionId to locate-anything-v2:

  • Template object_detection β†’ detect command (by processingCategories).
  • Template grounding β†’ ground command (locate via processingPhrase).

The latter is the killer feature: describe what to monitor in one sentence, and the camera locates it zero-shot, always-on.

5.3 Via AI Chat​

Tell AI Chat "use locate-anything to count the people in red vests in this image" β€” the LLM calls the command and interprets the result.


6. Typical Scenarios​

6.1 Natural-language find / zero-shot counting​

Use ground + phrase to find / count anything, no training needed:

  • phrase = people in red vests β†’ count safety supervisors.
  • phrase = red products on the shelf β†’ out-of-stock / display checks.
  • phrase = trash on the floor β†’ environment inspection.

Returns all matching locations and a count; pair with Automation Rules to trigger alerts.

6.2 Defect / foreign-object localization​

Describe the anomaly (e.g. scratch, leftover tool, foreign object); after the model locates it, combine with ROI or manual review. Suited to sporadic, occasional defect checks without training a model per defect type.

6.3 Text and GUI localization​

  • detect_text: locate all text in a frame (lighter than OCR β€” positions only).
  • ground_gui / point: locate UI elements or point to objects in screenshots, useful for RPA, automated testing, and accessibility.

7. Selection: locate-anything vs yolo-device-inference​

Dimensionyolo-device-inferencelocate-anything-v2
ClassesFixed (COCO 80 / custom model)Open-vocabulary (natural language, zero-shot)
LatencyMillisecondsSeconds (VLM)
DeploymentLocal ONNX, edge-runnableRequires a GPU inference service
Best forStable detection of known classes, high throughputAd-hoc needs, unknown classes, "find X in words"

Known classes and speed β†’ yolo; "find things in words" or fluid classes β†’ locate-anything. Both can be swapped in the NE101 camera component.


8. Appendix​


Last updated: 2026-07-13