Structure frontend

class limap.runners.StructureFrontendOptions(max_image_dim: int | None = None, camera_mode: CameraMode | None = None, metainfo: MetaInfoComputerOptions = <factory>, image_description: ImageDescriptionOptions = <factory>, image_association: ImageAssociationOptions = <factory>, cleanup_workspace: bool = True)

Options for structure frontend.

__init__(max_image_dim: int | None = None, camera_mode: CameraMode | None = None, metainfo: MetaInfoComputerOptions = <factory>, image_description: ImageDescriptionOptions = <factory>, image_association: ImageAssociationOptions = <factory>, cleanup_workspace: bool = True) None
camera_mode: CameraMode | None = None
cleanup_workspace: bool = True
image_association: ImageAssociationOptions
image_description: ImageDescriptionOptions
max_image_dim: int | None = None
metainfo: MetaInfoComputerOptions
class limap.runners.StructureFrontendOutputs(db_path: Path, structure_db_path: Path, image_dir: Path, neighbors: dict[int, list[int]], ranges: tuple[ndarray, ndarray] | None, model_dir: Path | None = None)

Outputs from structure frontend.

__init__(db_path: Path, structure_db_path: Path, image_dir: Path, neighbors: dict[int, list[int]], ranges: tuple[ndarray, ndarray] | None, model_dir: Path | None = None) None
db_path: Path
image_dir: Path
model_dir: Path | None = None
neighbors: dict[int, list[int]]
ranges: tuple[ndarray, ndarray] | None
structure_db_path: Path
limap.runners.structure_frontend_from_model(options: StructureFrontendOptions, image_dir: Path, model_dir: Path, output_dir: Path, neighbors: dict[int, list[int]] | None = None, ranges: tuple[ndarray, ndarray] | None = None, skip_if_exists: bool = False) StructureFrontendOutputs

Run structure frontend for a posed model on disk.

Use this when images have known poses (e.g., for triangulation). The model is read from model_dir, undistorted, and optionally resized.

Parameters:
  • options – Frontend options

  • image_dir – Path to image directory

  • model_dir – Path to COLMAP model directory (with poses)

  • output_dir – Output directory

  • neighbors – Optional pre-computed neighbors

  • ranges – Optional pre-computed ranges

  • skip_if_exists – Skip if databases already exist

Returns:

StructureFrontendOutputs with paths to outputs

limap.runners.structure_frontend_from_images(options: StructureFrontendOptions, image_dir: Path, recon: Reconstruction, output_dir: Path, neighbors: dict[int, list[int]] | None = None, skip_if_exists: bool = False) StructureFrontendOutputs

Run structure frontend from an in-memory reconstruction.

Use this when images do NOT have poses (e.g., for SfM from scratch). The reconstruction is passed in-memory to avoid COLMAP’s binary format which drops unposed frames/images.

Parameters:
  • options – Frontend options

  • image_dir – Path to image directory

  • recon – In-memory Reconstruction with cameras and images (no poses required)

  • output_dir – Output directory

  • neighbors – Optional pre-computed neighbors

  • skip_if_exists – Skip if databases already exist

Returns:

StructureFrontendOutputs with paths to outputs

limap.runners.cleanup_frontend_workspace(output_dir: Path) None

Remove intermediate frontend files that are no longer needed.

After detection and matching results are imported into database.db and structure_database.db, the intermediate files under output_dir/frontend/ (descriptors, detections, matchings) are no longer needed. This function deletes them to save disk space while preserving group description files needed for later stages.

Parameters:

output_dir – The output directory passed to the frontend.

limap.runners.structure_frontend.databases_are_complete(db_path: Path, structure_db_path: Path, num_images: int) bool

Check that the databases hold results for every image of the model.

A run that was interrupted partway leaves both files on disk while still incomplete. Reusing one produces an empty reconstruction, so check the contents rather than only whether the files exist.