Tutorial: find ships off a port#
Find ships in five days of satellite imagery of a port, on your own GPU, starting from one example. You download Sentinel-2 scenes of the ports of Los Angeles and Long Beach, embed the image chips of the harbor, serve them from the local stack, and ask which chips look most like one chip that shows a ship at anchor. The answer is recorded as a finding in the Geospatial Knowledge Base (GKB).
This chip shows a ship. Which chips of these scenes look
most like it? Record the answer as a finding.
The embedded area on 4 October 2026, with the example chip outlined. Each chip is 1.28 km wide. Contains modified Copernicus Sentinel data 2026.#
Step |
What runs |
What it shows |
|---|---|---|
Set up the repository |
|
The workspace and the skills catalog |
1. Build the pipeline image |
Docker |
cuGeo’s GPU decoder, built from source |
2. Get the scenes |
A download script |
Real public data over a range of days |
3. Embed the harbor |
Your GPU |
cuGeo reads and resamples the bands; Clay encodes the chips |
4. Serve the vectors |
The local stack |
Retrieval over embeddings |
5. Ask the question |
An MCP connection |
The tools and skills an agent gets |
6. See the matches |
Your GPU, the console |
Ships on other days, and a finding with evidence |
The tutorial uses three packs: the Sentinel pack reads the scenes and makes the chips, the Clay pack defines the embedding space that is searched, and the Maritime pack’s vessel detector is the next step for confirming what the search finds (Next).
This page starts from a machine without the repository. Nothing is assumed to be built.
Prerequisites#
These come from outside the repository:
Need |
For |
|---|---|
An NVIDIA GPU with a CUDA 13 driver |
Embedding the scenes |
Docker with Compose v2, BuildKit and the NVIDIA Container Toolkit |
The pipeline image and the local stack |
|
The workspace |
The repository address, and read access to the cuGeo repository through Git |
The clone and the pipeline image |
Free disk: about 16 GB for the pipeline image, about 18 GB for the stack’s images, and about 10 GB for the scenes and the Clay checkpoint |
The steps below |
The builds download from PyPI, npm, Docker Hub, GitHub’s container registry and NVIDIA NGC. The scenes come from the public Sentinel-2 archive on Google Cloud Storage, which needs no account.
Set up the repository#
Do this once. Skip a step you have already done.
Clone the GeoNeMo repository and enter it.
git clone https://github.com/NVIDIA/geonemo.git geonemo cd geonemo
Run every later command from this folder, the repository root.
Create the workspace environment,
.venv:uv sync --locked --all-packages --extra dev --python 3.12
Prepare the release inputs. The server image and the MCP bridge bundle the tested skills catalog, and these commands build and install it:
sh ci/prepare-public-skills.shThe script assembles the catalog from this checkout and installs it for local use.
The image build fetches the latest cuGeo
mainfrom GitHub. To use a mirror, setCUGEO_REPOSITORYbefore building.export CUGEO_REPOSITORY=https://github.com/NVIDIA/cugeo.git
Choose an empty working folder for the scenes and their vectors, with about 10 GB free. The steps below call it
$SAMPLE:export SAMPLE=<an-empty-folder> mkdir -p "$SAMPLE"
Install and Run the local stack explain steps 1 to 3 in more detail.
Steps#
Build the pipeline image,
geonemo-pipeline:local. It holdscugeo-pipelinewith cuGeo’s GPU JPEG 2000 decoder, Clay v1.5 and cuVS. GeoNeMo does not publish this image, so you build it here from the cuGeo source. The build compiles only and does not use the GPU; it takes a few minutes.packs/sentinel/examples/similar-chips/build-pipeline-image.sh
The script ends by checking that the image starts and that the GPU decoder is in it.
Get the scenes. The script downloads the Sentinel-2 L2A scenes of tile 11SLT sensed from 4 to 24 October 2026 that are nearly cloud-free and cover the whole tile: five scenes, five days apart, about 3 GB in all.
python3 packs/sentinel/examples/similar-chips/fetch-scenes.py \ $SAMPLE/scenes
It prints each scene it takes or skips, with the limit a skipped scene exceeds.
--tile,--start,--endand--max-cloudchoose another place or period, and--listonly lists.Embed the harbor on the GPU.
--bboxis the area to embed, as west, south, east and north in degrees: the terminals, the anchorage inside the breakwater and the water outside it. This step and step 6 use GPU 0; add--gpu Nto either command to use another one.packs/sentinel/examples/similar-chips/embed-scenes.sh \ $SAMPLE/scenes $SAMPLE \ --bbox -118.29,33.63,-118.10,33.78
For each scene, cuGeo decodes the ten 10 m and 20 m bands on the GPU and resamples each chip to one 128-pixel grid, and Clay turns the chip into a 1024-value vector. The first run downloads the Clay checkpoint into
$SAMPLE/cache. On one H100, the 910 chips of the five scenes take about one minute, checkpoint download and model load included. A warning about unauthenticated requests to the Hugging Face Hub is harmless; settingHF_TOKENis optional.The table is
$SAMPLE/vectors/sentinel2: one row per chip with its vector, pixel position, center coordinates and sensing time. The local stack serves fewer than 1024 chips, so keep the area and the number of scenes small.Serve the table:
packs/sentinel/examples/similar-chips/serve-table.sh \ $SAMPLE/vectors/sentinel2
The script pins the table as the dataset
s2-sample, builds and starts the local stack with retrieval, loads and indexes the dataset, and waits until it is searchable. It also writes$SAMPLE/vectors/geonemo-scope.json, the scope file that lets an MCP connection search this dataset and publish findings. A pinned table cannot change: to embed again, use a new$SAMPLEand rundeploy/development/dev.sh down -vfirst.Ask the question. The script makes the MCP calls an agent harness would make, so you can see each call and its result.
--nearand--datename the example: the chip outlined in the picture above, which shows one ship at anchor on 4 October..venv/bin/python docs/examples/similar_chips_tour.py \ $SAMPLE/vectors/geonemo-scope.json \ --near 33.673,-118.129 --date 2026-10-04
It starts the MCP stdio bridge with the scope file, lists the tools and the skills, and then:
Call
What the server does
retrieval_list_corporaLists what can be searched
retrieval_list_artifactsLists the stored chips, a page at a time, without their vectors
retrieval_contractsNames the search profile of the chips’ embedding space
retrieval_searchRanks the chips of all five days by distance to the example chip’s stored vector
gkb_publishValidates the finding’s Markdown and stores it
gkb_get_artifactReturns the stored finding
Choosing the example chip and dropping it from its own matches are the agent’s steps; the script does them in Python. The search uses the chip’s stored vector, so no encoder runs.
The output is trimmed here. Each line names a chip by product, pixel position, center and sensing time, and the score is the negative distance, so higher is closer:
32 tools, 11 skill resources > retrieval_list_corpora {} {"items": [{"id": "s2-sample", "counts": {"vectors": 910, "searchable_vectors": 910, ...}}]} 910 chips from 5 days: 2026-10-04, 2026-10-09, 2026-10-14, 2026-10-19, 2026-10-24 > retrieval_search {"request": { "corpus_id": "s2-sample", "profile_id": "profile_04a0...", "queries": {"space_3c3d...": {"kind": "artifact", "artifact_id": "dataset_70e7..."}}, "limit": 15}} Query chip: S2C_MSIL2A_20261004... r7296 c9472 (33.6727, -118.1288) 2026-10-04T18:45:04Z 1 -0.03568 ..._20261014... r7040 c9472 (33.6958, -118.1291) 2 -0.05940 ..._20261024... r7296 c9344 (33.6726, -118.1426) 3 -0.06101 ..._20261014... r7040 c9344 (33.6957, -118.1429) 4 -0.06443 ..._20261019... r6912 c9216 (33.7071, -118.1568) ... Matches per day: 2026-10-04: 3, 2026-10-14: 2, 2026-10-19: 4, 2026-10-24: 5 > gkb_publish {"markdown": "---\ngkb_schema: '1.0'...", "idempotency_key": "similar-chips-tour-gkb_01M8...", "publication_requested": true} {"receipt": {"artifact_id": "gkb_01M8AN32381QF8AYZVMT10SSW3", "durability": "committed", "duplicate": false, ...}, "viewer_link": "/gkb/gkb_01M8AN32381QF8AYZVMT10SSW3"}Each run records a new finding.
--limitchanges the number of matches. The bridge’s own log, one line per HTTP request, goes to$SAMPLE/vectors/tour.log.See the matches. The tour wrote
$SAMPLE/vectors/matches.json; this script cuts those chips from the scenes in true color, decoding the bands with cuGeo on the GPU, and writes$SAMPLE/vectors/matches.png:packs/sentinel/examples/similar-chips/show-matches.sh \ $SAMPLE/vectors/matches.json $SAMPLE/scenes
The example chip and its 14 closest chips from that run. Every one shows a ship, on four of the five days. Contains modified Copernicus Sentinel data 2026.#
Then open the finding at the address the tour printed, in the console at
http://127.0.0.1:3101. The console listens on the machine that runs the stack; from another machine, forward the port first withssh -L 3101:127.0.0.1:3101 <host>. Choose Embeddings, opens2-sampleand Explore: select a chip and choose Find similar to this embedding to run the same search by hand.Ask a harness the same question. Configure it to start the stdio bridge with the scope file, as under “stdio with a scope file” in Connect an MCP client, with the command
.venv/bin/geonemo-mcp. Then paste the question at the top of this page with the example chip’s coordinates. The harness chooses its own calls; expect the same tools.
Result#
You have a searchable set of Clay vectors made from five days of one port on your GPU, the chips that look most like one ship chip, and a GKB finding that cites them.
What the result is and is not:
The search ranks by likeness to one example. It found ships here because an anchored ship on open water looks unlike empty water. It does not count ships, tell a container ship from a tanker, or see ships at a berth apart from the terminal around them.
A day without matches is not a day without ships: no chip of 9 October was among the 14 closest.
Similarity in embedding space is a starting point for an analyst, not a validated detection.
Clean up#
Stop the stack and delete its volumes:
deploy/development/dev.sh down -v
Remove the pipeline image, which is about 16 GB:
docker image rm geonemo-pipeline:local
Delete the working folder,
$SAMPLE.
The stack’s own images stay for the next up; docker image ls lists them.
Next#
Goal |
Page |
|---|---|
Confirm ships with the Maritime pack’s Sentinel-2 vessel detector, which needs NeMo Platform |
|
Call the same stack with the client, |
|
Ask a catalog question over HTTP MCP |
|
Work from raw L1B granules: surface reflectance computed on demand by cuGeo |
|
Embed L1B granules instead of L2A products |
|
Know what the pipeline does and its options |
|
Register your own imagery in the catalog |