API Reference#

The classes and factory functions below are importable from the top-level rapidtools package (import rapidtools as rt) as well as from the subpackage shown; the lower-level functions listed by module name (street_fusion.fuse_observations, …) are imported from that module. 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.

OperationCanceled

Raised by a component when its cancel_event has been set.

is_canceled

Return True if cancel_event exists and has been set.

raise_if_canceled

Raise OperationCanceled if cancel_event has been set.

Pipeline and analysis#

Pipeline

A 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.

DroneImageExtractor

Attach to every asset the drone photos that show the most of it.

DroneViewSelector

Pick, for every asset, the drone photos that show the most of 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.

feature_extractors.is_building_prompt

Whether a text prompt asks for buildings.

feature_extractors.ScanSettings

The scan settings in effect for a prompt (see SAM3OrthoFeatureExtractor.scan_settings()).

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.

FootprintRegularizer

Pipeline component that gives building footprints straight, square walls.

RoadwayRegularizer

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

instance_fusion.fuse_view_detections

Fuse detections from overlapping views into one outline per object.

postprocessing.footprints.regularize_footprint

Turn a mask-traced footprint into a building-like outline.

postprocessing.footprints.regularize_footprints

Regularize a set of neighboring footprints together.

vectorize.mask_to_wgs84_polygons

Vectorize a binary mask into valid WGS84 polygons.

Street-level localization#

How sightings in street-level images become positioned objects: the camera model, occupancy fusion, structures from the survey’s point cloud, the earlier tracking and triangulation method with its covariance-aware merging and 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 normalized 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 meters along each sequence.

street_fusion.fuse_observations

Turn the sightings of one class into objects by occupancy fusion.

street_fusion.scan_from_observation

Read a sighting's outline as a scan: its lower and upper edge per column.

street_fusion.set_range_bands

Turn a scan's lower edge into an occupied range band per column.

street_fusion.FusedObject

One object found by occupancy fusion.

aerial_evidence.AerialEvidence

The detections of one class in an overhead image, with what they weigh.

aerial_evidence.LocalAerialEvidence

Aerial evidence in a local meter frame (see AerialEvidence.to_local()).

aerial_evidence.estimate_offset

Shift that lines overhead detections up with objects placed from the street.

aerial_evidence.Registration

Where a street survey and an overhead image disagree, place by place.

aerial_evidence.register_to_image

Move objects placed from the street onto an overhead image's positions.

street_tiles.tile_layout

Square tiles that cover the part of a frame where objects stand.

street_tiles.cut_tile

Cut one tile out of a frame, across the seam of a panorama if need be.

street_tiles.join_tile_masks

Outlines, on the whole frame, of the masks found in its tiles.

street_structures.discover_structures

Find the structures of one class in a survey's point clouds.

street_structures.label_points

Vote: keep the reconstructed points most frames place on the class.

street_structures.structures_from_points

Group labeled points into structures and outline each one.

street_structures.footprint_rectangle

Rectangle footprint of a structure seen from the street.

street_structures.footprint_stepped

Footprint whose front follows the setbacks of the facade.

street_structures.front_most

Which points of a cloud a panorama can see.

street_structures.ground_level

Altitude of the ground under points of a cloud, read from the cloud.

street_structures.drawn_as_one

Whether the frames in front of two wall pieces outline them as one building.

street_instances.discover_instances

Find buildings from one outline per building and frame.

street_instances.mask_outlines

Outer outlines of a binary mask in normalized image coordinates.

street_instances.survey_points

The reconstructed points around a set of frames, and the frames' poses.

street_instances.outline_memberships

Which reconstructed points every outline holds.

street_instances.link_outlines

Group outlines of different frames that show the same building.

street_instances.track_points

Assign every reconstructed point to the track it belongs to, if any.

street_footprints.footprint_sightings

Say which outlines show which known footprints.

street_footprints.footprint_region

The part of a panorama a footprint raised to a box projects onto.

street_footprints.FootprintViews

What a survey saw of one known footprint.

street_structures.fetch_sfm_cluster

Download (or read from cache_dir) one point-cloud cluster.

street_structures.Structure

One building (or other structure) found in the labeled point cloud.

street_structures.PointCloud

One structure-from-motion cluster of a survey.

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 neighbor into that neighbor.

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-normalized 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 catalog of a provider (no network).

model_defaults

Return the per-model default settings that apply to model_id.

set_model_defaults

Set default settings for a model ID (or a prefix ending in *).

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 and Muse Wonder.

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.

DroneCamera

One drone photograph: where the camera was, where it looked, and its lens.

read_drone_images

Read the camera poses of a set of drone photos.

read_pose_table

Read camera poses from a sidecar table.

write_pose_metadata

Save a JPEG that carries camera as EXIF GPS tags and DJI-style XMP.

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.

JSON job interface#

The file format is specified in JSON job interface.

run_job

Run a job file (or an in-memory job) and return its result.

JobRunner

Executes jobs with a workflow engine.

JobResult

The outcome of a job, mirrored in its result file.

StepResult

The outcome of one step.

Job

A job: where to write, and the steps to run in order.

StepSpec

One step of a job, exactly as written in the job file.

new_job

Build a job in memory, ready to be saved or run.

load_job

Accept a job in any of its forms and return a Job.

Secrets

Resolves the secret references of a job.

JobError

A job document, or one of its steps, is not valid.

StepType

A kind of step a job may contain.

Param

One option of a step type.

Input

One piece of data a step type reads.

Output

One file a step type writes that later steps may read.

StepContext

Everything a step needs to run, and the place it reports back to.

register_step

Make a step type available to job files.

get_step_type

Look up a step type by the name used in job files.

job_schema

Return the JSON Schema (draft 2020-12) of a job file.

result_schema

Return the JSON Schema (draft 2020-12) of a job result file.

secrets_schema

Return the JSON Schema (draft 2020-12) of a secrets file.

describe_steps

Return the catalog of step types as plain JSON data.

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.