Skip to main content

Model versions

Retrieve trained models, browse their inference results, and download model artifacts.

Module methods

sdk.model_version exposes:

  • get(model_version_id) - Fetch a single model version.
  • get_by_date_range(model_trained_after, model_trained_before, exclude_draft=False) - List models trained within a window.

Inference results

Each InferenceResultResource lets you read the raster output of a model run:

  • raw_data - The unfiltered inference raster as a NumPy array.
  • median_filtered_data - The same raster with median filtering applied.
  • get_data(post_processing_method, threshold_start, threshold_end, threshold_mode) - Pull the data with optional thresholding. For unmixing and target-detection models, threshold_mode=CLASSIFY returns a binary mask within the threshold band; STRETCH linearly rescales values inside the band to [0, 1].
  • download(folder_path, post_processing_method) - Download the inference COG to disk.

Example

from datetime import datetime
from fusion_sdk.models.thresholding_mode_enum import ThresholdingModeEnum

# Fetch a single model
model = sdk.model_version.get(model_version_id=38)
model.download(folder_path="/local/downloads/models")

# Inspect inference results
for inference_result in model.inference_results:
classified = inference_result.get_data(
threshold_start=0.2,
threshold_end=0.8,
threshold_mode=ThresholdingModeEnum.CLASSIFY,
)
print(inference_result.image_id, classified.shape)

# List models trained in a date range
recent = sdk.model_version.get_by_date_range(
model_trained_after=datetime(2025, 1, 1),
model_trained_before=datetime(2025, 12, 31),
exclude_draft=True,
)