Data Models#
The hastegeo.core.models package contains Pydantic data models used throughout the HASTE platform for validation, serialization, and type safety.
Projects (hastegeo.core.models.projects)#
Core domain models for HASTE projects:
PrimaryClass— Damage/feature classification definitionGeometry— GeoJSON-style geometry (point, polygon, linestring, etc.)Properties— Feature properties with classification and metadataLabel— Individual annotation for imageryLabelingImagery— Imagery display configuration for the labeling toolFeature— Geographic feature for labeling tasksLabelProject— Complete labeling project with features, labels, and imagery configTrainingJob— ML training job metadata (status, epochs, timing)InferenceJob— Model inference job execution metadataCheckpoint— Model checkpoint state persistenceModelRequest— Request to create/configure a modelModel— Complete ML model configuration and lifecycleZipTypeEnum— Enum for zip job types (TRAINING, INFERENCE)ZipJob— File archiving job for model artifactsModelArtifacts— Model artifact management and packaging state
- class hastegeo.core.models.projects.BuildingValidation(*, imageLayerId=None, projectId=None, labels=<factory>, dependsOn=('ImageLayer', 'imageLayerId'))[source]#
Bases:
BaseModelStores building-footprint validation results for an image layer.
Labels are shared across all users for a given image layer (last-write-wins). The
labelsdict maps each Overture building ID to its ValidationLabel.- Parameters:
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.Checkpoint(*, checkpointId=None, checkpointUrl=None, checkpointPath=None, modelId=None, projectId=None, creationDate=None, dependsOn=('Model', 'modelId'))[source]#
Bases:
BaseModelRepresents a model checkpoint saved during training in the HASTE system.
This model captures checkpoint metadata for model state persistence during training processes. Checkpoints enable training resumption and provide access to intermediate model states for evaluation and deployment.
- Parameters:
checkpointId (Optional[str]) – Unique identifier for the checkpoint instance
checkpointUrl (Optional[str]) – URL location of the checkpoint file in storage
checkpointPath (Optional[str]) – File system path to the checkpoint data
modelId (Optional[str]) – Reference to the model that generated this checkpoint
projectId (Optional[str]) – Reference to the parent project containing the model
creationDate (Optional[str]) – ISO formatted timestamp when checkpoint was created
dependsOn (Optional[tuple[str, str]]) – Dependency tuple specifying parent resource type and ID
Note
Checkpoints may be stored as directories containing multiple files rather than single checkpoint files, depending on the model framework.
Example
```python checkpoint = Checkpoint(
checkpointId=”ckpt_123”, modelId=”model_456”, checkpointPath=”/models/checkpoint_epoch_10.pth”
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.Feature(*, type='Feature', featureId=None, geometry=None, bbox=None, assignedCount=0)[source]#
Bases:
BaseModelGeographic feature definition for labeling tasks.
Represents a geographic feature that can be assigned to labeling tasks, typically corresponding to areas or regions of interest within imagery.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.Geometry(*, type=None, coordinates=None)[source]#
Bases:
BaseModelGeoJSON-style geometry definition.
Represents spatial geometry data following GeoJSON specification. Used for defining geographic features and regions of interest.
- coordinates#
Coordinate array structure depends on geometry type.
- Type:
List, optional
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.ImageLayer(*, imageLayerId=None, projectId=None, labelProjectId=None, name=None, description=None, workflowType='standard', format=None, sourceType=None, sourceTypePreEvent=None, sourceTypePostEvent=None, imageryCaptureDatePreEvent=None, imageryCaptureDatePostEvent=None, normalizationFactor=None, imageryCaptureDate=None, preEventImageryUrls=None, preEventPreviewUrls=<factory>, preEventMosaicCogImageryUrl=None, preEventProcessedImageryUrl=None, postEventImageryUrls=None, postEventPreviewUrls=<factory>, postEventMosaicCogImageryUrl=None, postEventProcessedImageryUrl=None, processedImageryUrls=None, rawImageryUrls=None, previewSourceImageryUrls=None, preprocessJob=None, imageryPath=None, userId=None, status=None, statusMessage='', currentStep=0, totalSteps=0, progressPct=0.0, creationDate=None, modelCount=0, labelProjectCount=0, autoFineTune=False, models=None, normalizationMeans=<factory>, normalizationStds=<factory>, labelProject=None, labelsUrl=None, buildingFootprintsUrl=None, userBuildingFootprintsUrl=None, validAreaMaskUrl=None, dependsOn=('Project', 'projectId'))[source]#
Bases:
BaseModelRepresents an imagery layer containing satellite or aerial imagery data in the HASTE system.
This comprehensive model manages imagery datasets including pre-event and post-event imagery for damage assessment, along with processing state, normalization parameters, and associated analysis models. Supports multiple imagery sources and formats.
- Parameters:
imageLayerId (Optional[str]) – Unique identifier for the imagery layer
projectId (Optional[str]) – Reference to the parent project containing this layer
labelProjectId (Optional[str]) – Reference to associated labeling project for ground truth
name (Optional[str]) – Human-readable name for the imagery layer
description (Optional[str]) – Detailed description of the imagery content and purpose
format (Optional[str]) – Imagery file format (e.g., ‘GeoTIFF’, ‘COG’)
sourceType (Optional[str]) – Legacy field for imagery source type (deprecated)
sourceTypePreEvent (Optional[str]) – Source type for pre-event imagery (e.g., ‘Sentinel-2’, ‘WorldView’)
sourceTypePostEvent (Optional[str]) – Source type for post-event imagery
imageryCaptureDatePreEvent (Optional[str]) – ISO formatted capture date for pre-event imagery
imageryCaptureDatePostEvent (Optional[str]) – ISO formatted capture date for post-event imagery
normalizationFactor (Optional[float]) – Scaling factor for pixel value normalization
imageryCaptureDate (Optional[str]) – Legacy field for capture date (deprecated)
preEventImageryUrls (Optional[list[str]]) – List of URLs to pre-event imagery files
preEventPreviewUrls (Optional[list[str]]) – List of URLs to pre-event preview/thumbnail images
preEventMosaicCogImageryUrl (Optional[str]) – URL to pre-event mosaic Cloud Optimized GeoTIFF
preEventProcessedImageryUrl (Optional[str]) – URL to preprocessed pre-event imagery
postEventImageryUrls (Optional[list[str]]) – List of URLs to post-event imagery files
postEventPreviewUrls (Optional[list[str]]) – List of URLs to post-event preview/thumbnail images
postEventMosaicCogImageryUrl (Optional[str]) – URL to post-event mosaic Cloud Optimized GeoTIFF
postEventProcessedImageryUrl (Optional[str]) – URL to preprocessed post-event imagery
processedImageryUrls (Optional[list[str]]) – Legacy field for processed imagery URLs (deprecated)
rawImageryUrls (Optional[list[str]]) – Legacy field for raw imagery URLs (deprecated)
previewSourceImageryUrls (Optional[list[str]]) – Legacy field for preview URLs (deprecated)
preprocessJob (Optional[ImageryPreprocessJob]) – Associated preprocessing job for this imagery layer
imageryPath (Optional[str]) – File system path to imagery data
userId (Optional[str]) – Identifier of the user who created the layer
status (Optional[str]) – Current processing status (e.g., ‘processing’, ‘ready’, ‘failed’)
statusMessage (Optional[str]) – Detailed status message for current processing state
currentStep (Optional[int]) – Current processing step number for progress tracking
totalSteps (Optional[int]) – Total number of processing steps expected
progressPct (Optional[float]) – Processing progress percentage (0.0 to 100.0)
creationDate (Optional[str]) – ISO formatted timestamp when layer was created
modelCount (Optional[int]) – Number of models trained on this imagery layer
labelProjectCount (Optional[int]) – Number of labeling projects using this layer
autoFineTune (Optional[bool]) – Whether to automatically fine-tune models with this imagery
models (Optional[List[Model]]) – List of models associated with this imagery layer
normalizationMeans (Optional[List[int]]) – Mean values for each spectral band for normalization
normalizationStds (Optional[List[int]]) – Standard deviation values for each spectral band
labelProject (Optional[LabelProject]) – Associated labeling project providing ground truth data
labelsUrl (Optional[str]) – URL to labels file for the imagery layer
buildingFootprintsUrl (Optional[str]) – URL to the cached building-footprint GeoPackage scoped to this layer’s AOI. Populated by the imageryprep workflow from either Overture Maps (default) or from the user-supplied
userBuildingFootprintsUrl(when set). Consumed by inference instead of re-downloading on every model run.userBuildingFootprintsUrl (Optional[str]) – Optional user-supplied URL pointing to a GeoPackage of building footprints. When set, the imageryprep workflow skips the Overture download and instead downloads this file, reprojects it to EPSG:4326, clips it to the layer’s AOI, and writes the result to
buildingFootprintsUrl. The URL must satisfyvalidate_footprint_url(same allowlist as imagery URLs plus the configured local upload host).validAreaMaskUrl (Optional[str]) – URL to a single-feature GeoJSON FeatureCollection containing the valid-data polygon (EPSG:4326) derived from the post-event mosaic, i.e. the imagery’s actual AOI excluding nodata. Populated by the imageryprep workflow; surfaced as a downloadable artifact in the UI.
dependsOn (Optional[tuple[str, str]]) – Dependency tuple specifying parent resource type and ID
Example
```python imagery_layer = ImageLayer(
imageLayerId=”layer_123”, name=”Hurricane Harvey - Houston”, sourceTypePreEvent=”Sentinel-2”, sourceTypePostEvent=”WorldView-3”, imageryCaptureDatePreEvent=”2017-08-20T00:00:00Z”, imageryCaptureDatePostEvent=”2017-08-30T00:00:00Z”
- labelProject: Optional[LabelProject]#
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- preprocessJob: Optional[ImageryPreprocessJob]#
- class hastegeo.core.models.projects.ImageryPreprocessJob(*, projectId=None, imageLayerId=None, jobId=None, taskId=None, status=None, logs=None, creationDate=None, completedDate=None, dependsOn=('ImageLayer', 'imageLayerId'))[source]#
Bases:
BaseModelRepresents an imagery preprocessing job in the HASTE system.
This model captures preprocessing job execution details for preparing raw imagery data for analysis and machine learning workflows. Preprocessing jobs run on Azure Batch services to handle large imagery datasets.
- Parameters:
projectId (Optional[str]) – Reference to the parent project containing the imagery
imageLayerId (Optional[str]) – Reference to the imagery layer being processed
jobId (Optional[str]) – Azure Batch job identifier for job management and monitoring
taskId (Optional[str]) – Azure Batch task identifier within the job
status (Optional[str]) – Current execution status (e.g., ‘running’, ‘completed’, ‘failed’)
logs (Optional[str]) – Processing logs and output messages from the job execution
creationDate (Optional[str]) – ISO formatted timestamp when job was created
completedDate (Optional[str]) – ISO formatted timestamp when job finished
dependsOn (Optional[tuple[str, str]]) – Dependency tuple specifying parent resource type and ID
Example
```python preprocess_job = ImageryPreprocessJob(
projectId=”proj_123”, imageLayerId=”layer_456”, status=”processing”
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.InferenceJob(*, uid=None, jobId=None, taskId=None, modelId=None, projectId=None, status=None, creationDate=None, completedDate=None, logs='', artifactZipJobUid=None, dependsOn=('Model', 'modelId'))[source]#
Bases:
BaseModelRepresents a machine learning model inference job in the HASTE system.
This model captures inference job execution metadata for applying trained models to new imagery data. Inference jobs run on Azure Batch services and generate prediction outputs for analysis and visualization.
- Parameters:
uid (Optional[str]) – Unique identifier for the inference job instance, DEPRECATED
jobId (Optional[str]) – Azure Batch job identifier for job management and monitoring
taskId (Optional[str]) – Azure Batch task identifier within the job
modelId (Optional[str]) – Reference to the trained model used for inference
projectId (Optional[str]) – Reference to the parent project containing input imagery
status (Optional[str]) – Current execution status (e.g., ‘running’, ‘completed’, ‘failed’)
creationDate (Optional[str]) – ISO formatted timestamp when job was created
completedDate (Optional[str]) – ISO formatted timestamp when job finished
logs (Optional[str]) – Inference logs and output messages from the job execution
artifactZipJobUid (Optional[str]) – Reference to zip job for packaging inference results
dependsOn (Optional[tuple[str, str]]) – Dependency tuple specifying parent resource type and ID
Example
```python inference_job = InferenceJob(
uid=”inf_123”, modelId=”model_456”, projectId=”proj_789”, status=”queued”
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.Label(*, type=None, properties=None, id=None, geometry=None)[source]#
Bases:
BaseModelIndividual label annotation for imagery analysis.
Represents a single labeled feature within an image, containing both geometric and semantic information about identified objects or areas.
- properties#
Feature properties and classification.
- Type:
Properties, optional
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- properties: Optional[Properties]#
- class hastegeo.core.models.projects.LabelProject(*, projectId=None, labelprojectId=None, imageLayerId=None, name=None, creationDate=None, labels=<factory>, imagery=None, features=None, dependsOn=('ImageLayer', 'imageLayerId'))[source]#
Bases:
BaseModelLabeling project containing features, labels, and imagery configuration.
Represents a complete labeling project that groups together imagery, features to be labeled, existing labels, and configuration for the labeling interface.
- imagery#
Imagery display configuration.
- Type:
LabelingImagery, optional
- imagery: Optional[LabelingImagery]#
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.LabelingImagery(*, enabled=None, type=None, tileSize=None, tileUrl=None, preEventTileUrl=None, postEventTileUrl=None, bounds=None)[source]#
Bases:
BaseModelConfiguration for imagery display in the labeling tool.
Defines how imagery should be displayed and accessed within the labeling interface, including tile server configurations and display parameters.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.Model(*, modelId=None, projectId=None, imageLayerId=None, labelprojectId=None, name=None, labelsCount=0, baseModel=None, baseModelWeightsUrl=None, initialWeightsUrl=None, outputModelWeightsUrl=None, learningRate=None, batchSize=None, maxEpochs=None, userId=None, creationDate=None, trainDate=None, status=None, currentStep=0, progressPct=0.0, totalSteps=0, statusMessage='', autoRunInference=True, checkpointPath=None, trainingOutputPath=None, inferenceOutputPath=None, trainingJob=None, inferenceJobs=<factory>, inferenceStatus=None, inferenceCurrentStep=0, inferenceProgressPct=0.0, inferenceTotalSteps=0, inferenceUid=None, currentInferenceTaskId=None, inferenceStatusMessage='', predictedDamageLayerUrl=None, gpkgUrl=None, labelsUrl=None, modelType='trained', embeddingModel=None, resizeFactor=None, numFeatures=None, embeddingJob=None, embeddingsGeoJSONUrl=None, pmtilesUrl=None, featuresSidecarUrl=None, dependsOn=('ImageLayer', 'imageLayerId'))[source]#
Bases:
BaseModelRepresents a machine learning model configuration and state in the HASTE system.
This comprehensive model captures all aspects of ML model lifecycle including training configuration, execution state, inference results, and output artifacts. Models are trained on labeled imagery data and deployed for damage detection.
- Parameters:
modelId (Optional[str]) – Unique identifier for the model instance
projectId (Optional[str]) – Reference to the parent project containing model data
imageLayerId (Optional[str]) – Reference to the imagery layer used for training
labelprojectId (Optional[str]) – Reference to the labeling project providing ground truth data
labelsCount (Optional[int]) – Number of training labels available for the model
baseModel (Optional[str]) – Base model architecture (e.g., ‘ResNet50’, ‘EfficientNet’)
baseModelWeightsUrl (Optional[str]) – URL to pre-trained base model weights
outputModelWeightsUrl (Optional[str]) – URL to trained model weights after completion
learningRate (Optional[str]) – Training learning rate parameter as string
batchSize (Optional[str]) – Training batch size parameter as string
maxEpochs (Optional[str]) – Maximum training epochs parameter as string
userId (Optional[str]) – Identifier of the user who created the model
creationDate (Optional[str]) – ISO formatted timestamp when model was created
trainDate (Optional[str]) – ISO formatted timestamp when training began
status (Optional[str]) – Current model status (e.g., ‘training’, ‘completed’, ‘failed’)
currentStep (Optional[int]) – Current training step number for progress tracking
progressPct (Optional[float]) – Training progress percentage (0.0 to 100.0)
totalSteps (Optional[int]) – Total number of training steps expected
statusMessage (Optional[str]) – Detailed status message for current model state
autoRunInference (Optional[bool]) – Whether to automatically run inference after training
checkpointPath (Optional[str]) – File path to saved model checkpoint
initialWeightsUrl (Optional[str]) – URL to initial weights file for model initialization
trainingOutputPath (Optional[str]) – Directory path for training output artifacts
inferenceOutputPath (Optional[str]) – Directory path for inference output artifacts
trainingJob (Optional[TrainingJob]) – Associated training job execution details
inferenceJobs (Optional[List[InferenceJob]]) – List of inference jobs run with this model
inferenceStatus (Optional[str]) – Current status of inference execution
inferenceCurrentStep (Optional[int]) – Current inference step for progress tracking
inferenceProgressPct (Optional[float]) – Inference progress percentage (0.0 to 100.0)
inferenceTotalSteps (Optional[int]) – Total number of inference steps expected
inferenceUid (Optional[str]) – Unique identifier for current inference execution, DEPRECATED
currentInferenceTaskId (Optional[str]) – Current inference task identifier
inferenceStatusMessage (Optional[str]) – Detailed inference status message
predictedDamageLayerUrl (Optional[str]) – URL to predicted damage layer output
gpkgUrl (Optional[str]) – URL to GeoPackage output file with predictions
labelsUrl (Optional[str]) – URL to labels file used for training
dependsOn (Optional[tuple[str, str]]) – Dependency tuple specifying parent resource type and ID
Example
modelId=”model_123”, name=”Building Damage Detection v1”, baseModel=”ResNet50”, learningRate=”0.001”, batchSize=”32”, maxEpochs=”100”, autoRunInference=True
- embeddingJob: Optional[TrainingJob]#
- inferenceJobs: Optional[List[InferenceJob]]#
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- trainingJob: Optional[TrainingJob]#
- class hastegeo.core.models.projects.ModelArtifacts(*, projectId=None, imageLayerId=None, modelId=None, currentZipJobUid=None, zipUrl=None, trainingZipUrl=None, trainingZipSize=None, inferenceZipUrl=None, inferenceZipSize=None, zipStatus=None, zipStatusMessage='', zipJobs=<factory>, dependsOn=('Model', 'modelId'))[source]#
Bases:
BaseModelRepresents model artifact management and packaging state in the HASTE system.
This model tracks the status and availability of model output artifacts, including training results, inference outputs, and packaged downloads. Coordinates zip job execution for artifact archiving and distribution.
- Parameters:
projectId (Optional[str]) – Reference to the parent project containing the model
imageLayerId (Optional[str]) – Reference to the imagery layer used by the model
modelId (Optional[str]) – Reference to the model that generated the artifacts
currentZipJobUid (Optional[str]) – Reference to the active zip job packaging artifacts
zipUrl (Optional[str]) – URL to the downloadable zip archive of model artifacts
zipStatus (Optional[str]) – Current status of the zip packaging operation
zipStatusMessage (Optional[str]) – Detailed message about zip operation status
zipJobs (Optional[List[ZipJob]]) – List of zip jobs associated with this model’s artifacts
dependsOn (Optional[tuple[str, str]]) – Dependency tuple specifying parent resource type and ID
Example
```python artifacts = ModelArtifacts(
projectId=”proj_123”, modelId=”model_456”, zipStatus=”completed”, zipUrl=”https://storage.blob.core.windows.net/artifacts/model_456.zip”
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.ModelRequest(*, modelId=None, projectId=None, imageLayerId=None, labelProjectId=None, status=None)[source]#
Bases:
BaseModelRepresents a request to create or configure a model in the HASTE system.
This model captures the parameters needed to initiate model creation, linking together project data, imagery layers, and labeling information required for training setup.
- Parameters:
modelId (Optional[str]) – Unique identifier for the requested model
projectId (Optional[str]) – Reference to the parent project containing training data
imageLayerId (Optional[str]) – Reference to the imagery layer for model input
labelProjectId (Optional[str]) – Reference to the labeling project providing ground truth
status (Optional[str]) – Current status of the model request (e.g., ‘pending’, ‘approved’)
Example
```python model_request = ModelRequest(
modelId=”model_123”, projectId=”proj_456”, imageLayerId=”layer_789”, labelProjectId=”labels_101”
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.PrimaryClass(*, name=None, color=None)[source]#
Bases:
BaseModelPrimary classification definition for labeling tasks.
Defines a primary class used in the labeling tool for categorizing damage or features in imagery analysis.
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.Project(*, projectId=None, name=None, description=None, affectedCountries=None, userId=None, eventDate=None, eventTypes=None, creationDate=None, imageLayerCount=0, imageLayer=None, primaryClasses=None)[source]#
Bases:
BaseModelRepresents a top-level project in the HASTE system for damage assessment analysis.
This model serves as the root container for all project-related resources including imagery layers, labeling projects, models, and analysis results. Projects typically correspond to specific disaster events or geographical areas of interest.
- Parameters:
projectId (Optional[str]) – Unique identifier for the project
description (Optional[str]) – Detailed description of the project scope and objectives
affectedCountries (Optional[List[str]]) – List of countries affected by the event being analyzed
userId (Optional[str]) – Identifier of the user who created the project
eventDate (Optional[str]) – ISO formatted date when the disaster event occurred
creationDate (Optional[str]) – ISO formatted timestamp when project was created
imageLayerCount (Optional[int]) – Number of imagery layers associated with the project
imageLayer (Optional[List[ImageLayer]]) – List of imagery layers containing satellite/aerial data
primaryClasses (Optional[List[PrimaryClass]]) – List of damage classification categories for labeling
Example
projectId=”proj_123”, name=”Hurricane Harvey 2017 - Houston Assessment”, description=”Building damage assessment for Hurricane Harvey impact in Houston”, affectedCountries=[“United States”], eventDate=”2017-08-25T00:00:00Z”
- imageLayer: Optional[List[ImageLayer]]#
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- primaryClasses: Optional[List[PrimaryClass]]#
- class hastegeo.core.models.projects.Projects(*, root=<factory>)[source]#
Bases:
BaseModelContainer model for managing multiple Project instances in the HASTE system.
This model provides a structured way to handle collections of projects, typically used in API responses and batch operations.
Example
```python projects = Projects(
- root=[
Project(name=”Hurricane Harvey Assessment”), Project(name=”California Wildfire Analysis”)
]
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.Properties(*, azureMapsShapeId=None, primaryClass=None, source=None, subType=None, radius=None)[source]#
Bases:
BaseModelProperties associated with a labeled feature.
Contains metadata and classification information for geographic features identified in imagery analysis and labeling tasks.
- primaryClass#
Primary classification of the feature. Aliased as ‘class’ for serialization compatibility.
- Type:
str, optional
Note
The primaryClass field is serialized as ‘class’ to maintain compatibility with training systems while avoiding Python reserved keyword conflicts.
- model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.TrainingJob(*, trainingjobUid=None, jobId=None, taskId=None, modelId=None, projectId=None, status=None, trainStartTime=None, completedEpochs='0', approxMinutesToComplete='', totalElapsedTime='', timePerEpoch='', logs=None, artifactZipJobUid=None, creationDate=None, completedDate=None, dependsOn=('Model', 'modelId'))[source]#
Bases:
BaseModelRepresents a machine learning model training job in the HASTE system.
This model captures comprehensive training job metadata including execution status, timing information, and resource dependencies. Training jobs are managed through Azure Batch services and produce trained model artifacts for inference.
- Parameters:
trainingjobUid (Optional[str]) – Unique identifier for the training job instance
jobId (Optional[str]) – Azure Batch job identifier for job management and monitoring
taskId (Optional[str]) – Azure Batch task identifier within the job
modelId (Optional[str]) – Reference to the model configuration being trained
projectId (Optional[str]) – Reference to the parent project containing training data
status (Optional[str]) – Current execution status (e.g., ‘running’, ‘completed’, ‘failed’)
trainStartTime (Optional[str]) – ISO formatted timestamp when training began
completedEpochs (Optional[str]) – Number of training epochs completed as string
approxMinutesToComplete (Optional[str]) – Estimated remaining training time in minutes
totalElapsedTime (Optional[str]) – Total time elapsed since training started
timePerEpoch (Optional[str]) – Average time per training epoch for progress estimation
logs (Optional[str]) – Training logs and output messages from the job execution
artifactZipJobUid (Optional[str]) – Reference to zip job for packaging training artifacts
creationDate (Optional[str]) – ISO formatted timestamp when job was created
completedDate (Optional[str]) – ISO formatted timestamp when job finished
dependsOn (Optional[tuple[str, str]]) – Dependency tuple specifying parent resource type and ID
Example
```python training_job = TrainingJob(
trainingjobUid=”train_123”, modelId=”model_456”, projectId=”proj_789”, status=”running”, completedEpochs=”5”
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.ValidationLabel(*, id, label, updatedAt)[source]#
Bases:
BaseModelRepresents a single building validation label assigned by a user.
- Parameters:
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.ZipJob(*, projectId=None, imageLayerId=None, modelId=None, uid=None, jobId=None, taskId=None, status=None, logs='', srcArtifactPaths=<factory>, dstZipPath=None, creationDate=None, completedDate=None, dependsOn=('ModelArtifacts', 'modelId'))[source]#
Bases:
BaseModelRepresents a file archiving job for packaging model artifacts in the HASTE system.
This model captures zip job execution details for packaging training outputs, inference results, and other model artifacts into downloadable archives. Zip jobs run on Azure Batch services to handle large file collections.
- Parameters:
projectId (Optional[str]) – Reference to the parent project containing artifacts
imageLayerId (Optional[str]) – Reference to the imagery layer associated with artifacts
modelId (Optional[str]) – Reference to the model that generated the artifacts
uid (Optional[str]) – Unique identifier for the zip job instance, DEPRECATED
jobId (Optional[str]) – Azure Batch job identifier for job management and monitoring
taskId (Optional[str]) – Azure Batch task identifier within the job
status (Optional[str]) – Current execution status (e.g., ‘running’, ‘completed’, ‘failed’)
logs (Optional[str]) – Job logs and output messages from the execution
srcArtifactPaths (Optional[List[str]]) – List of source file paths to include in the archive
dstZipPath (Optional[str]) – Destination path for the generated zip file
creationDate (Optional[str]) – ISO formatted timestamp when job was created
completedDate (Optional[str]) – ISO formatted timestamp when job finished
dependsOn (Optional[tuple[str, str]]) – Dependency tuple specifying parent resource type and ID
Example
projectId=”proj_123”, modelId=”model_456”, srcArtifactPaths=[“/models/weights.pth”, “/logs/training.log”], dstZipPath=”/archives/model_artifacts.zip”
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.projects.ZipTypeEnum(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
Enumeration of zip job types in the HASTE system.
Defines the supported types of artifact packaging operations, distinguishing between training and inference output archiving.
- TRAINING#
Zip job for packaging training artifacts and outputs
- INFERENCE#
Zip job for packaging inference results and predictions
- INFERENCE = 'inference'#
- TRAINING = 'training'#
Admin (hastegeo.core.models.admin)#
Administrative configuration models:
SourceType— Imagery source configurationBaseModels— Base model artifact metadataDrawingTools— Labeling tool drawing capabilities (polygon, rectangle, circle)Grid— Grid visualization settingsDefaultPrimaryClass— Default classification for labelingLabelingToolSettings— Complete labeling UI configurationAdminConfig— Administrative configuration container
- class hastegeo.core.models.admin.AdminConfig(*, sourceTypes=<factory>, baseModels=<factory>, labelingToolSettings=<factory>)[source]#
Bases:
BaseModel- baseModels: List[BaseModels]#
- labelingToolSettings: LabelingToolSettings#
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- sourceTypes: List[SourceType]#
- class hastegeo.core.models.admin.BaseModels(*, baseModelId=0, name=None, sourceURL=None, creationDate=None)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.admin.DefaultPrimaryClass(*, name=None, color=None)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.admin.DrawingTools(*, polygon=False, rectangle=False, circle=False)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.admin.Grid(*, gridStrokeColor=None)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.admin.LabelingToolSettings(*, drawingTools=<factory>, grid=<factory>, defaultPrimaryClasses=<factory>, tileServerSettings=None)[source]#
Bases:
BaseModel- defaultPrimaryClasses: List[DefaultPrimaryClass]#
- drawingTools: DrawingTools#
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Training (hastegeo.core.models.training)#
ML training and experiment configuration:
ModelSource(Enum) — Model source: HASTE or EXTERNALImagery— Imagery normalization and channel configurationInference— Inference job configuration (batch size, GPU, output path)Labels— Training label configurationTraining— Training hyperparameters (learning rate, batch size, epochs, GPU)ExperimentConfig— Complete experiment configuration for trainingCatalogModel— Model catalog entry with metadata
- class hastegeo.core.models.training.CatalogModel(*, baseModelName, description=None, modelId=None, projectId=None, imageLayerId=None, imagerySource=None, checkpointFilePath=None, eventTypes=None, cataloguedDate=None, cataloguedByUser, additionalInfo=None, source=ModelSource.HASTE, usedByModels=<factory>)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- source: ModelSource#
- class hastegeo.core.models.training.ExperimentConfig(*, experiment_dir=None, experiment_name=None, imagery=None, inference=<factory>, labels=None, training=None)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.training.Imagery(*, normalization_means=None, normalization_stds=None, num_channels=None, raw_fn=None, rgb_fn=None)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.training.Inference(*, output_subdir='', batch_size=1, gpu_id=0, checkpoint_fn='', padding=None, patch_size=None, building_footprints_source=None, country_alpha2_iso_code=None, predictions_gpkg_fileprefix=None)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.training.Labels(*, buffer_in_meters=None, class_to_buffer=None, class_to_buffer_by=None, classes=None, fn=None)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.training.ModelSource(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
-
- EXTERNAL = 'external'#
- HASTE = 'haste'#
- class hastegeo.core.models.training.Training(*, batch_size=None, checkpoint_subdir=None, gpu_id=None, learning_rate=None, log_dir=None, max_epochs=None, use_constraint_loss=False, initial_weights_fn=None)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Statistics (hastegeo.core.models.stats)#
Project statistics models:
ImageLayerStats— Statistics for an image layer (ID, label count)ProjectStats— Project-level statistics (layers, models, labels, countries)StatsRequest— Request to update project statisticsProjectsSummary— Container for all project statistics
- class hastegeo.core.models.stats.ImageLayerStats(*, imageLayerId=None, labelsCount=0)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.stats.ProjectStats(*, projectId=None, name=None, description=None, creationDate=None, imageLayerStats=<factory>, modelIds=<factory>, affectedCountries=<factory>, imageLayerCount=0, modelsCount=0, labelsCount=0)[source]#
Bases:
BaseModel- imageLayerStats: Optional[List[ImageLayerStats]]#
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.stats.ProjectsSummary(*, projects=<factory>)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- projects: Optional[List[ProjectStats]]#
- class hastegeo.core.models.stats.StatsRequest(*, action=None, projectId=None, name=None, description=None, creationDate=None, imageLayerStats=None, modelIds=<factory>, affectedCountries=<factory>)[source]#
Bases:
BaseModel- imageLayerStats: Optional[ImageLayerStats]#
- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Users (hastegeo.core.models.users)#
User management models:
User— User profile and role informationUsers— Container for list of usersInvite— Invitation with email, roles, link, and send statusInvites— Container for list of invitationsAddUsersRequest— Request to add multiple users with roles
- class hastegeo.core.models.users.AddUsersRequest(*, emails=<factory>, roles=<factory>, added_by)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.users.Invite(*, email_id, roles=<factory>, invitation_link=None, email_sent=False, error=None)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.users.Invites(*, results=<factory>)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.users.User(*, userId=None, objectId=None, name=None, email=None, userRoles=<factory>, identityProvider=None, settings=<factory>, status=None, added_by=None, added_on=None, updated_on=None, deleted=False)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Visualizer (hastegeo.core.models.visualizer)#
Visualization configuration:
Imagery— Imagery layer configuration (URL, TMS, attribution, zoom bounds)Visualizer— Visualization config with pre/post event imagery and damage predictions
- class hastegeo.core.models.visualizer.Imagery(*, url='', tms=False, attribution='AI For Good Lab', minZoom=12, maxNativeZoom=20, maxZoom=21, bounds=<factory>)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class hastegeo.core.models.visualizer.Visualizer(*, projectId='', imageLayerId='', modelId='', projectName='', studyArea=<factory>, eventDate=None, predictedDamageImageryDownloadUrl='', preDisasterImagery=<factory>, postDisasterImagery=<factory>, predictedDamageLayer=<factory>, predictionsLayer=<factory>, sourceTypePreEvent=None, sourceTypePostEvent=None, imageryCaptureDatePreEvent=None, imageryCaptureDatePostEvent=None)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Uploader (hastegeo.core.models.uploader)#
File upload models:
FileUploadRequest— File upload status and progress tracking
- class hastegeo.core.models.uploader.FileUploadRequest(*, projectId=None, fileId=None, totalChunks=None, chunkNumber=None, status=None, statusMessage=None, outputUrl=None, updatedDate=None)[source]#
Bases:
BaseModel- model_config: ClassVar[ConfigDict] = {}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].