API Reference#

Everything below is importable from the top-level rapidtools package as well as from the subpackage shown. Heavy dependencies load on first use.

Core objects#

PhysicalAsset

Represents a tangible, real-world entity.

PhysicalAssetCollection

A specialized container for collection of PhysicalAsset objects.

ImageAsset

A single image asset, its location, metadata, and segmentation info.

ImageCollection

A container class for managing a group of ImageAsset objects.

BoundingBox

Represents an axis-aligned rectangular region.

PolygonRegion

Represents a geographical region defined by a single polygon shell.

Observation

One sighting of an object in a street-level image.

OperationCancelled

Raised by a component when its cancel_event has been set.

is_cancelled

Return True if cancel_event exists and has been set.

raise_if_cancelled

Raise OperationCancelled if cancel_event has been set.

Pipeline and analysis#

Pipeline

A smart sequence of processing steps applied to a PhysicalAssetCollection.

Stage

Execution order of pipeline steps (lower runs first).

PipelineStep

Structural type of a pipeline step.

AssetAnalyzer

Describe every asset in a collection with a vision-language model.

RateLimitPolicy

Shared back-off applied by AssetAnalyzer to hosted APIs.

DetectionVerifier

Confirm that each detected object is what its asset type claims.

DuplicateResolver

Merge pairs of nearby objects that a model says are one vehicle.

Imagery extractors#

AerialImageryExtractor

Component that extracts aerial imagery patches for a collection of assets.

BingOrthomosaicExtractor

Component that extracts and synthesizes aerial imagery from Bing Maps Tiles.

GoogleOrthomosaicExtractor

Component that stitches Google Maps satellite tiles into a GeoTIFF.

GoogleStreetViewImageExtractor

Street-view extractor that fetches keyless Google Street View crops of assets.

MapillaryImageExtractor

Street-view extractor that fetches unobstructed Mapillary panoramas of assets.

MapillaryObjectImageExtractor

Crop each detected object out of the street-level images that saw it.

MapillaryLabelMapper

Map natural-language class names to exact Mapillary segmentation labels.

Detection, segmentation and regularization#

SAM3OrthoFeatureExtractor

Pipeline component that uses local SAM 3 to discover real-world assets.

MapillaryFeatureExtractor

Discover objects along a Mapillary survey and place them on the ground.

SAM3ImageSegmenter

Pipeline component that uses local SAM 3 to segment images attached to assets.

BuildingRegularizer

Pipeline component to regularize and refine preliminary building polygons.

RoadwayRegularizer

Pipeline component to regularize jagged raster-to-vector road polygons.

vectorize.mask_to_wgs84_polygons

Vectorize a binary mask into valid WGS84 polygons.

Street-level localisation#

How sightings in street-level images become positioned objects: the camera model, tracking and triangulation, covariance-aware merging, the ray-voting baseline and appearance re-identification.

street_localization.localize

Fill in the single-view ground position of an observation.

street_localization.observation_angles

Bearing to an observation and elevation of its ground contact.

street_localization.pixel_bearing

Unit direction in the camera frame of a normalised image point.

street_localization.world_ray

Rotate a camera-frame direction into the world (east, north, up) frame.

street_localization.rotation_matrix

Rotation matrix of an axis-angle vector (Rodrigues' formula).

street_localization.intersect_bearings

Least-squares intersection of bearings from several camera positions.

street_localization.estimate_ego_mask

Find detections of the collection vehicle itself.

street_localization.thin_frames

Keep one frame per spacing_m metres along each sequence.

street_tracking.discover_objects

Turn the sightings of one class into object estimates.

street_tracking.suppress_duplicate_sightings

Drop a detector's duplicate outlines within each frame.

street_tracking.prune_unwitnessed

Drop estimates that nearby frames should have seen but did not.

street_tracking.CameraFrame

Where one survey frame was taken and what it could see.

street_tracking.track_sequence

Link the sightings of one sequence into tracks, one per object.

street_tracking.merge_by_rays

Merge estimates whose lines of sight point at the same object.

street_tracking.triangulate_track

Position a track from its rays, or None when it is not a static object.

street_tracking.merge_estimates

Fuse estimates of the same object; keep different objects apart.

street_tracking.merge_pieces

Fold objects that are really pieces of a neighbour into that neighbour.

street_tracking.sighting_shows

Whether a sighting can be of an object at target.

street_tracking.vote_rays

Locate objects as peaks of accumulated ray votes on a ground grid.

street_tracking.ObjectEstimate

One candidate object: a position with uncertainty and its sightings.

reid.AppearanceEmbedder

L2-normalised image embeddings from a Hugging Face vision backbone.

reid.merge_by_appearance

Group candidates that are close together and look alike.

reid.pairs_to_compare

List the candidate pairs whose appearance is worth comparing.

reid.views_for_reid

The sightings of a candidate worth cropping for re-identification.

reid.polygon_width_px

Width of a detection outline in pixels of the image it was drawn on.

reid.crop_observation

Cut the axis-aligned crop of a detection polygon out of its source image.

reid.recommended_min_similarity

Cosine-similarity threshold that suits a backbone.

Provider-specific analyzers#

These predate AssetAnalyzer and remain for compatibility. New code should use AssetAnalyzer(load(provider, ...)).

GeminiAssetAnalyzer

Deprecated: use AssetAnalyzer(load('gemini', ...)).

ClaudeAssetAnalyzer

Deprecated: use AssetAnalyzer(load('claude', ...)).

OpenAIAssetAnalyzer

Deprecated: use AssetAnalyzer(load('openai', ...)).

MuseSparkAssetAnalyzer

Deprecated: use AssetAnalyzer(load('muse_spark', ...)).

QwenAssetAnalyzer

Deprecated: use AssetAnalyzer(load('qwen', ...)).

Gemma4AssetAnalyzer

Deprecated: use AssetAnalyzer(load('gemma4', ...)).

LlamaVisionAssetAnalyzer

Deprecated: use AssetAnalyzer(load('llama', ...)).

MuseGlimmerAssetAnalyzer

Deprecated: use AssetAnalyzer(load('muse_glimmer', ...)).

QwenVisionAssetAnalyzer

Deprecated: use AssetAnalyzer(load('qwen_vl', ...)).

HFVisionAssetAnalyzer

Deprecated: use AssetAnalyzer(load('hf', ...)).

Models#

The provider registry rapidtools.models.PROVIDERS maps each registry key to a ModelInfo record and is always importable without PyTorch.

load

Instantiate a model wrapper from its registry key.

list_providers

Return registry keys, optionally filtered by kind.

catalog

Return the curated model catalogue of a provider (no network).

get_model_class

Import and return the wrapper class registered under provider.

ModelInfo

Static description of a model backend.

GenerationConfig

Text-generation options shared by every vision-language wrapper.

SegmentationConfig

Options for promptable segmentation models such as SAM 3.

ModelOutput

A universal container for multimodal AI model outputs.

BaseInferenceModel

The top-level contract for all AI models (API or local).

Hosted models#

GeminiInference

Google Gemini generateContent client for image + text prompts.

ClaudeInference

Anthropic Claude Messages API client for image + text prompts.

OpenAIInference

OpenAI Chat Completions client for image + text prompts.

MuseSparkInference

Meta Model API client for the Muse Spark family.

QwenInference

Alibaba Cloud Model Studio (DashScope) client for hosted Qwen models.

Local models#

Gemma4Inference

Local inference model for Google's Gemma 4 vision-language models.

LlamaVisionInference

Local inference with Meta's Llama 4 and Llama 3.2 Vision models.

MuseGlimmerInference

Local inference with Meta's open-weight Muse Glimmer vision-language model.

QwenVisionInference

Local inference with open-weight Qwen vision-language checkpoints.

HFVisionInference

Run any Hugging Face vision-language checkpoint that ships a chat template.

SAM3Inference

Text-prompted instance segmentation with SAM 3.

Data sources#

OrthomosaicReader

Client for extracting high-resolution imagery from local orthomosaic rasters.

orthomosaic_reader.PatchGeoref

Native georeferencing of an image patch read from a raster.

GoogleAerialImageExtractor

Client for extracting satellite imagery from Google Maps tiles.

BingAerialImageExtractor

Client for extracting high-resolution imagery from Bing Maps tiles.

GoogleStreetViewClient

Keyless client for locating, downloading and cropping Street View panoramas.

StreetViewPanorama

Metadata describing one Google Street View panorama.

MapillaryClient

Fetch and store Mapillary images by ID or geographic bounding box.

MapillaryLabels

Namespace of official Mapillary segmentation label strings.

TileUtils

Utility methods for Web Mercator/Mapbox Vector Tile operations.

Datasets, configuration and authentication#

datasets.download_dataset

Download all files associated with one or more datasets from the registry.

config.configure_logging

Attach a console handler to the rapidtools logger.

config.get_configured_session

Create a requests Session with retry logic, timeouts, and headers.

config.resolve_alias

Pop a deprecated keyword alias from kwargs and return the value.

models.api_base.api_session

Return a session with the retry policy used for provider API calls.

auth.login

Authenticate this machine with the Hugging Face Hub.

auth.ensure_huggingface_login

Log in only when no Hugging Face token is cached yet.

Graphical interface#

launch_asset_analysis_app

Start the GUI server and open it in the default browser (blocks).

AssetAnalysisWorkflow

Orchestrates asset detection and VLM inference on an aerial raster.

DetectionSettings

User-configurable options for the asset detection stage.

StreetDetectionSettings

Options for AssetAnalysisWorkflow.discover_street().

RegionImagerySettings

Options for AssetAnalysisWorkflow.download_basemap().

InferenceSettings

User-configurable options for the VLM inference stage.

AssistSettings

Options for AssetAnalysisWorkflow.assist().

NotificationConfig

Where notifications are sent from.

Notifier

Send job summaries by email or webhook.

JobSummary

What a finished job looks like to the recipient.

PromptSpec

Everything needed to assemble a prompt in the rapidtools sample layout.

OutputField

One line of the REQUIRED OUTPUT FORMAT block.

RubricEntry

Description of one class of the primary categorical field.

assemble_prompt

Render a PromptSpec in the layout of the rapidtools sample prompts.

PromptAssistant

Use a rapidtools model backend to help write a PromptSpec.