Home hyperFVC
LNSOTOM/fvc_function
  • main branch
hyperFVC
Research workflow guide

Map vegetation functional states

Follow three phases from drone imagery and reference labels to spectral models and fractional vegetation cover maps.

Overview

Map vegetation functional states

FVC Function uses drone multispectral and hyperspectral imagery to map bare earth (BE), non-photosynthetic vegetation (NPV), and photosynthetic vegetation (PV). The workflow aligns imagery and reference labels, trains sensor-specific U-Net models, and produces prediction maps.

Browse the study’s tables and figures in the interactive manuscript viewer.

Framework

Framework architecture

The paper evaluates an NPV-aware U-Net for multispectral and imaging spectroscopy data. The spectral front end feeds the same spatial encoder–decoder across all five ablation variants.

Core research modules

Spectral adapter

Reweight input bands and project them into a 32-channel learned spectral embedding before the U-Net encoder. Each channel is a learned spectral feature.

Lightweight cross-channel attention

Use global spatial summaries to estimate interactions between the learned channels in M4 and M5.

Vegetation segmentation

Use a U-Net to map photosynthetic vegetation (PV), non-photosynthetic vegetation (NPV), and bare earth (BE).

Geographic evaluation

Use three spatial folds at the source site and frozen models for zero-shot evaluation on five external-site tiles.

Companion 2D-to-3D workflow

Use fvc3d to project growth-form labels onto LiDAR and check label consistency.

Edge inference

Export trained models to ONNX and benchmark TensorRT inference on the Jetson platform.

Optional external integrations

Package adapters can connect compatible third-party PyTorch encoders and segmentation models. Check their input channels and output format before integration.

Next. Set up the environment to reproduce the paper, or install the hyperFVC package to use the models in your own code.

Reproduce the paper | Setup

Set up the workflow environment

Where to start

Start with Image processing for raw orthomosaics or Quick start to try the Python model.

1. Prerequisites

Use Git and micromamba for the research environment. See the environment guide for GPU and Docker options.

2. Create the environment

git clone https://github.com/LNSOTOM/fvc_function.git
cd fvc_function
micromamba env create -n fvc_function -f environment.yml
micromamba activate fvc_function

3. Configure data paths

Set the roots in configs/paths.yaml or pass environment overrides such as FVC_DATA_ROOT.

python utils/fvc_paths.py --check

Continue to Phase 1

Phase 1 | Image processing

Prepare aligned imagery tiles

Start with georeferenced drone orthomosaics. Use a common footprint and tile IDs for the imagery and labels.

1. Set the reference grid

Reproject the inputs to a common CRS and construct the site grid.

A 30.70 metre reference grid on the Calperum MICA orthomosaic, with tiles 65, 96, and 113 outlined in yellow, teal, and pink.
Calperum reference grid. The 30.70 m grid is anchored to the recorded tile footprints and overlaid on the MICA orthomosaic in GDA2020 / MGA zone 54 (EPSG:7854). The outlines mark the three tiles clipped below.
Calperum FX10–FX17 orthomosaic with the same reference grid and outlines for tiles 65, 96, and 113.
Hyspec (FX10–FX17) reference grid. The combined orthomosaic was reprojected to the MICA grid in EPSG:7854. The marked cells use the same tile IDs and footprints as the MICA example.

2. Clip the orthomosaics

Export tiles with consistent extents across the available sensors.

Three MICA crops clipped to the recorded footprints for tiles 65, 96, and 113, preserving the same false-colour display as the orthomosaic.
MICA orthomosaic clips. Each 10 cm MICA crop covers the same 30.70 m footprint as its 5 cm reference grid tile. Each clip is 307 × 307 pixels and retains all 10 bands. Both figures display bands 10, 6, and 2 as red, green, and blue.
Combined FX10–FX17 clips for tiles 65, 96 and 113 at 10 cm resolution, matching the MICA tile footprints.
Hyspec (FX10–FX17) orthomosaic clips. Each clip is 307 × 307 pixels at 10 cm and contains the 296 reflectance bands. Both Hyspec figures display bands nearest 650, 550, and 470 nm as red, green, and blue.

Reference grid and clipping module

Install the imagery extra from the repository root with python -m pip install -e '.[imagery]'. Replace the example paths with your files. Import the existing reference tiles to keep their IDs and footprints. For a new row-major grid, use reference-grid --raster INPUT --tile-size 307 --output grid.json.

hyperfvc reference-grid \
  --reference-tile 65 reference/tile-65.tif \
  --reference-tile 96 reference/tile-96.tif \
  --reference-tile 113 reference/tile-113.tif \
  --output grid.json

hyperfvc plot-grid --grid grid.json --input mica.dat \
  --bands 10 6 2 --output mica-grid.png

hyperfvc plot-grid --grid grid.json --input fx10-fx17.dat \
  --bands 87 50 19 --output hyspec-grid.png
hyperfvc clip-orthomosaic --grid grid.json --input mica.dat \
  --output-dir clips --prefix mica --resolution 0.10

hyperfvc clip-orthomosaic --grid grid.json --input fx10-fx17.dat \
  --output-dir clips --prefix hyspec --resolution 0.10

Change --resolution to set the output pixel size in grid CRS units. Use --tile-ids 65 113 to process a subset, or --bands to export selected source bands. Omitting --bands from the clipping command exports every band. To preview a single clip, run plot-grid on its GeoTIFF with the same --tile-ids value and display bands. The Python equivalents are build_reference_grid(), reference_grid_from_tiles(), plot_reference_grid(), and clip_orthomosaic() in hyperFVC.imagery.

3. Prepare predictor cubes

Compute normalization statistics and stack the selected bands. Follow the Phase 1 guide for the commands.

Per-band means and 2nd to 98th percentile reflectance ranges for the MICA and Hyspec example tiles, with strips showing the band order in each predictor cube.
Per-band statistics and predictor order. Statistics pool valid pixels from Calperum tiles 65, 96, and 113. MICA retains 10 bands. Hyspec stacks 206 FX10 bands (source bands 10–215) followed by 90 FX17 bands (source bands 7–96). Blue shading marks the 15 interpolated water-absorption bands.

The percentile envelopes show the reflectance spread of these example clips. Use the model profile’s expected normalization when preparing inputs for a trained checkpoint.

Predictor preparation module code

Use band_statistics() on tiles from one sensor profile. A scale factor of 10,000 converts the integer values in these examples to reflectance. Use stack_predictor_bands() on aligned inputs. Band numbers are one-based, and the order in the input list becomes the output band order.

from hyperFVC.imagery import band_statistics, stack_predictor_bands

tile_ids = (65, 96, 113)
mica_stats = band_statistics(
    [f"clips/mica-{tile}.tif" for tile in tile_ids],
    scale_factor=10_000, percentiles=(2, 98),
)
hyspec_stats = band_statistics(
    [f"clips/hyspec-{tile}.tif" for tile in tile_ids],
    scale_factor=10_000, percentiles=(2, 98),
)

stack_predictor_bands(
    [("fx10-aligned.dat", range(10, 216)),
     ("fx17-aligned.dat", range(7, 97))],
    "fx10-fx17-predictors.tif",
)

Next. Use the grid and tile IDs to align reference labels.

Phase 2 | Reference data

Prepare FVC reference labels

1. Prepare annotations

Convert LabelMe annotations to polygons and prepare the bare-earth class.

Site 01 tile 113 vegetation polygons over MICA imagery beside its MSAVI-derived bare-earth candidate mask.
Site 01 annotation polygons and bare-earth candidates. The Calperum example uses the archived georeferenced annotations for SASMDD0001 tile 113. NPV and PV outlines are overlaid on MICA imagery. The second panel shows BE candidates from MSAVI using scaled NIR and red reflectance.

2. Rasterize and mask

Create class rasters and handle shadow and water according to the site’s label scheme.

Site 01 tile 113 rasterized FVC and shadow classes, the mask after shadows are set to ignore, and the excluded shadow pixels.
Rasterized classes and shadow masking. On Site 01 tile 113, the georeferenced annotations and derived BE candidates are merged on the 5 cm grid. The centre panel shows shadow set to ignore. The right panel isolates the excluded shadow pixels.

3. Match the predictor grid

Downsample labels with majority voting and check the tile ID, CRS and grid. See the Phase 2 guide.

Full Site 01 tile 113 label raster with a marked inset, followed by the same inset at 5 cm and after majority-vote resampling to the 10 cm Hyspec grid.
Majority vote on the Hyspec grid. The same Site 01 tile 113 footprint is shown at 5 cm and 10 cm. Each 10 cm pixel receives the most frequent valid label from its 2 × 2 source cells. A group with no valid source labels stays ignored. In this example, ties use the lower class code. The output matches the 307 × 307 Hyspec predictor grid.

Next. Pair predictor tiles and reference rasters for modelling.

Phase 3 | Modelling

Train and apply FVC models

1. Select a sensor profile

Choose MICA multispectral, FX10, FX17 or the combined FX10–FX17 input. Match the bands, class codes and normalization to the profile; see the training and inference runbook.

2. Prepare training and evaluation splits

Use spatial blocks and keep evaluation tiles apart from training and augmentation.

Matrices showing the training, validation, and held-out test assignment of each parent tile in the three Hyspec and MICA folds.
Recorded Hyspec and MICA splits. Each column is a parent tile. Each row shows that tile’s role in one of the three folds.
Three spatial blocks rotate through the held-out test role. The other blocks supply training and validation patches. The selected model is evaluated on the held-out block.
Three-fold spatial block cross-validation. Original Figure 9 from Sotomayor et al. (2025), Landscape Ecology, reproduced under CC BY 4.0.

The hyperFVC experiments use 8 training, 3 validation, and 4 held-out test tiles per fold. All patches from a parent tile stay together. With nine patches per tile, that gives 72 training, 27 validation, and 36 test patches.

Patch extraction module code

Use hyperFVC.imagery.iter_paired_patches() on a 304 × 304 predictor and its aligned reference mask. Set the patch size and stride in pixels. The same window is read from both rasters, with the original tile ID attached for the spatial split.

from hyperFVC.imagery import iter_paired_patches

# Size and stride in pixels. A 304 × 304 tile yields 9, 4, and 1 patches.
for size, stride in ((152, 76), (224, 80), (304, 304)):
    patches = list(iter_paired_patches(
        "tiles_hyperspectral_113.dat",
        "mask_tile113_fulltile.tif",
        tile_id=113, patch_size=size, stride=stride,
    ))
    print(size, len(patches))

Use min_valid_fraction to exclude patches with insufficient valid imagery or labels. For prediction comparisons, use the checkpoint trained for each patch size. The original patch export script and training runbook are also available.

Build loaders for a spatial fold

Use hyperFVC.evaluation.data_loader to build PyTorch loaders for the recorded tile assignments. Supply an image–mask dataset and one parent tile ID per sample, in dataset order. Pass an optional augmented version of the same dataset as train_dataset to apply augmentation during training.

from hyperFVC.evaluation.data_loader import build_fold_loaders

# patch_tile_ids repeats the parent ID for every patch in dataset.
train_loader, validation_loader, test_loader = build_fold_loaders(
    dataset,
    patch_tile_ids,
    validation_tiles={34, 182, 205},
    test_tiles={22, 25, 26, 55},
    batch_size=8,
)

3. Train with data augmentation

Augmentation is applied during training only. The manuscript’s core protocol was used for FX10, FX17, and combined FX10–FX17 hyperspectral inputs. The MICA multispectral configuration used the same core protocol plus a shadow-robust add-on.

Training augmentation protocols and per-operation probabilities (manuscript Table 7)
OperationProtocolAugmentation typeProbability
Horizontal flipCoreGeometric0.5
Vertical flipCoreGeometric0.5
Random rotation in 90° incrementsCoreGeometric0.5
Mild coherent brightness–contrast jitterCoreRadiometric0.5
Global gain jitterMICA add-onRadiometric0.5
Per-band gain jitterMICA add-onRadiometric0.5
Gamma adjustmentMICA add-onRadiometric0.35
Mild Gaussian noiseMICA add-onRadiometric0.2
Synthetic shadow patchesMICA add-onShadow simulation0.35

Apply each geometric transform identically to the predictor patch and its PV, NPV, and BE mask. Apply radiometric and shadow changes only to reflectance. Preserve invalid and unlabelled pixels as ignore regions.

MICA image and class-mask pairs for the original patch, the four core operations, and the five MICA-only operations. The mask moves with flips and rotation and stays fixed for radiometric changes.
MICA (5 cm). Image and reference-mask pairs from Calperum tile 113 show the original patch, the four core operations, and the five MICA-only operations. Bands 10, 6, and 2 are displayed as red, green, and blue, respectively. The reference mask was aligned to the predictor grid with nearest-neighbour resampling.
Hyspec (FX10–FX17) image and class-mask pairs for the original patch, horizontal flip, vertical flip, 90-degree rotation, and coherent brightness–contrast jitter.
Hyspec (10 cm). The FX10–FX17 patch from the same tile 113 footprint shows the original patch and the four core operations. The plot displays three visible channels from the hyperspectral stack.

Build an augmentation pipeline by sensor

Install the augmentation extra from the repository root with python -m pip install -e '.[augmentation]'. Select "mica" for the core protocol and shadow-robust additions, or "hyspec" for the four core operations. Pass in the full reflectance cube and its aligned class mask.

import numpy as np
from hyperFVC.augmentation import build_augmentation

augment = build_augmentation("hyspec")  # Use "mica" for multispectral inputs.
# image has shape (height, width, bands); mask has shape (height, width).
ignore = (~np.isfinite(mask) | (mask == -1)).astype(np.uint8)
result = augment(image=image, mask=mask, ignore_mask=ignore)
augmented_image = result["image"]
augmented_mask = result["mask"].astype(np.float32)
augmented_mask[result["ignore_mask"] != 0] = np.nan

4. Run inference and evaluate

Use a matching checkpoint on the held-out test tiles. Metrics come from deterministic inference: hard class predictions, with softmax outputs for probability maps.

Calperum within-site deterministic FVC predictions from Hyspec at 10 cm and MICA at 5 cm, shown with imagery, reference overlays, and zoomed insets.
Deterministic FVC predictions (manuscript Figure 6). The top panel shows Hyspec (FX10–FX17, 10 cm) and the bottom panel shows MICA (5 cm) over a 15.2 × 15.2 m ground footprint. The class maps show BE in yellow, NPV in purple, and PV in pink.

Original orthomosaic inference script

Run the streaming inference script from the repository root. Set the sensor profile, input path, checkpoint, and window size to match the model you trained.

SENSOR_PROFILE=fx10_fx17_215_trim_aug_spec_transformer_weights_s152 \
  python phase_3_models/unet_site_models/inference_FVCmapping_streaming.py \
  --input-raster fx10-fx17.dat --checkpoint-path m5-hyspec-152.pth \
  --tile-size 152 --output-mask fvc-predictions.tif

Deterministic inference module code

Use hyperFVC.evaluation.zero_shot.predict_classes() for an already prepared batch with the trained model’s band order and normalization. The module uses evaluation mode and returns one class ID per pixel.

from hyperFVC.evaluation.zero_shot import predict_classes

# model: loaded checkpoint; image: (batch, bands, height, width).
# valid_mask: Boolean tensor (batch, height, width) on the same device.
class_ids = predict_classes(model, image)
class_ids = class_ids.masked_fill(~valid_mask, 255)

See the package quick start to write class IDs to a GeoTIFF with the predictor’s CRS and transform.

Monte Carlo dropout uncertainty. As a separate post-inference diagnostic, keep the network’s dropout layers (p = 0.3) active with the weights fixed and run T = 50 stochastic forward passes per patch. The pixel-wise epistemic uncertainty is the mean class-wise standard deviation of the logits across the passes; map it alongside the FVC classes.

Monte Carlo dropout uncertainty maps for Hyspec at 10 cm and MICA at 5 cm. Each sensor row shows an orthomosaic crop and a zoomed inset with NPV and PV boundaries.
Monte Carlo dropout uncertainty (manuscript Figure 7). Hyspec (FX10–FX17, 10 cm) is above MICA (5 cm). Purple and pink outlines mark NPV and PV boundaries. Both rows use the same display range of 0.10–0.65. Raw values are retained for analysis.

Monte Carlo dropout module code

from hyperFVC.evaluation.uncertainty import mc_dropout_uncertainty

# image: (batch, bands, height, width), prepared for the trained model.
# valid_mask: (batch, height, width), True where the image contains valid data.
uncertainty = mc_dropout_uncertainty(
    model,
    image,
    num_passes=50,
    valid_mask=valid_mask,
)  # (batch, height, width); invalid pixels are NaN.

Edge deployment. Export a trained model to ONNX and build a TensorRT engine for an NVIDIA Jetson AGX Orin. In the paper, the FX10–FX17 model ran 1.70× faster as an FP16 TensorRT engine than as an FP32 one (9.62 vs 16.31 ms per tile), with 99.96% of pixel labels matching the PyTorch model. See the Jetson guide; this was benchmarked on the device, not flown.

Next. Compare the trained models in the benchmark.

Experiments

Model benchmark design

Internal ablation

Compare M1–M5 to assess the spectral adapter, transformer and NPV weighting within the U-Net family.

M1–M5 variants
Baseline-method comparison

Compare the M5 pipeline with five baselines on the combined 296-band FX10–FX17 input.

Benchmark baselines
Patch size and predictions

Compare map detail and within-site scores at 152, 224, and 304 pixels.

Compare patch sizes
Water-absorption sensitivity

Compare M5 with and without the 15 interpolated channels in the water-absorption interval.

Compare band inputs

Internal ablation | M1–M5

VariantSpectral featuresClass weights (BE, NPV, PV)
M1Baseline U-NetUnweighted
M2Spectral adapterUnweighted
M3Spectral adapter1, 2, 1
M4Spectral adapter and transformerUnweighted
M5Spectral adapter and transformer1, 2, 1

See the ablation notes for the sensor profiles and patch scales.

NPV F1, mean F1, and mIoU for variants M1 to M5. M5 leads in NPV F1. M3 leads in mean F1 and mIoU.
Within-site ablation scores. Scores average the within-site sensor and patch-size configurations for each variant.
BE, NPV, and PV F1 score for M1–M5, with a mean F1 line. Panels show MICA, FX10–FX17, FX10, and FX17.
Class-wise within-site F1 score (Appendix A.4). The bars show bare ground (BE), non-photosynthetic vegetation (NPV), and photosynthetic vegetation (PV). The line shows macro-averaged mean F1.
BE, NPV, and PV intersection-over-union (IoU) for M1–M5, with a mean IoU line. Panels show MICA, FX10–FX17, FX10, and FX17.
Class-wise within-site intersection-over-union (IoU) (Appendix A.5). The bars show bare ground (BE), non-photosynthetic vegetation (NPV), and photosynthetic vegetation (PV). The line shows macro-averaged mean IoU.

Comparison with baseline methods

The 296-band benchmark used identical spatial folds and held-out tiles for M5, a per-pixel Random Forest, plain U-Net M1, PCA-3 and PCA-10 U-Nets, and a published spectral–spatial CNN. The comparison measures complete training pipelines, including M5’s NPV-weighted loss. See the external comparison notebook for the saved figures and tables.

Held-out F1 and IoU by class and model, with macro-average lines. SS3FCN leads for BE, M5 for NPV, and U-Net M1 for PV in both metrics.
Class-wise held-out scores. Bars show class scores averaged over the three held-out folds. Dark lines show macro-averaged F1 and IoU across BE, NPV, and PV.

How patch size affects predictions

At the same 10 cm pixel resolution, larger FX10–FX17 patches cover more ground. On Calperum tile 65, 152 px patches retained smaller NPV fragments and local boundaries. Maps from 224 and 304 px patches showed smoother, more continuous regions.

Calperum tile 65 reference and FX10–FX17 predictions from M1, M3 and M5 at 152, 224 and 304 pixels, with M5 Monte Carlo uncertainty in the last column.
Patch size and mapped detail (manuscript Figure 5). The original imagery and reference mask are shown above the three patch-size rows. Columns compare M1, M3, and M5, followed by M5 Monte Carlo dropout uncertainty.
Within-site FX10–FX17 M5 scores by patch size (manuscript Figure 4)
Patch sizeGround widthNPV F1mIoU
152 × 152 px15.2 m0.4610.573
224 × 224 px22.4 m0.4790.621
304 × 304 px30.4 m0.5000.637

For M5, 304 px scored highest within site. On the five external tiles, the selected 152 px model achieved mIoU of 0.455 and the selected 304 px model achieved 0.107. See the geographic evaluation for context.

Water-absorption band exclusion

The FX10–FX17 sensitivity experiment removed the 15 interpolated channels within the atmospheric water-absorption interval of 1320.9–1419.62 nm. Both runs used the same spatial folds, patch generation, M5 configuration, and evaluation metrics.

Mean FX17 reflectance curves for bare earth, non-photosynthetic vegetation and photosynthetic vegetation, with the interpolated water-absorption interval shaded in blue.
With interpolated bands. The saved FX17 notebook plot shows mean class spectra and one standard deviation across 30 regions. The blue interval spans 1320.9–1419.62 nm.
The same FX17 class spectra with a visible gap in all three curves across the excluded water-absorption interval.
With the bands excluded. The gap shows which channels were omitted in the 281-band experiment. Both views use the calibrated spectra archived with the study.
Non-photosynthetic vegetation (NPV) F1 by FX10–FX17 input
Interpolated water-absorption channelsInput bandsNPV F1
With the 15 channels296 bands0.461
Without the 15 channels281 bands0.409

Excluding the channels lowered NPV F1 by 0.052 under the tested conditions.

Geographic evaluation

Frozen source-site models were evaluated on five manually reviewed tiles from SASMDD0013. The highest zero-shot NPV F1 was 0.120 across the evaluated models. These results describe the five evaluated tiles. Read the preprint.

Next. That completes the reproduction workflow. To use the models in your own code, install the hyperFVC package.

Package | Installation

Install hyperFVC

From the repository root, install with Python 3.10 or newer.

python -m pip install -e .
hyperfvc variant M5

Development version

The editable install uses your local checkout. Install .[imagery] for raster preparation, .[augmentation] for training transforms, .[onnx] for ONNX export, or .[labels3d] for LiDAR label transfer.

Next. Build your first model in the quick start.

Package | Quick start

Build a spectral U-Net

Create a five-band, three-class M5 model. Load matching trained weights before inference. If you haven’t installed the package yet, see Install hyperFVC.

from hyperFVC.configs import load_variant
from hyperFVC.segmentation.unet import UNetModel

preset = load_variant("M5")
model = UNetModel(in_channels=5, out_channels=3, **preset["model"])

Clip orthomosaics with hyperFVC

Install the imagery extra with python -m pip install -e '.[imagery]'. Run clip_orthomosaic() for each sensor with the same grid manifest to produce aligned MICA and Hyspec GeoTIFFs.

from hyperFVC.imagery import clip_orthomosaic

tiles = clip_orthomosaic(
    "mica.dat", "grid.json", "clips",
    resolution=0.10, tile_ids=[65, 96, 113], prefix="mica",
)

See Phase 1 orthomosaic clipping for the CLI commands and the paired MICA and Hyspec examples.

Export a vegetation map and a labelled point cloud

For the raster example, install rasterio and use one predictor tile already normalized and ordered for your checkpoint. Match the model variant, band count and architecture to the saved weights. The example uses M5 and a plain PyTorch state dict.

import numpy as np
import rasterio
import torch

from hyperFVC.configs import load_variant
from hyperFVC.evaluation.zero_shot import predict_classes
from hyperFVC.segmentation.unet import UNetModel

vegetation_map = "vegetation_map.tif"
with rasterio.open("hyperspectral.tif") as src:
    tile = src.read(masked=True, out_dtype="float32")
    profile = src.profile.copy()

model = UNetModel(tile.shape[0], 3, **load_variant("M5")["model"])
model.load_state_dict(torch.load("spectral_unet.pth", map_location="cpu", weights_only=True))
values = tile.filled(0)
valid = ~np.ma.getmaskarray(tile).any(axis=0) & np.isfinite(values).all(axis=0)
values[:, ~valid] = 0
classes = predict_classes(model, torch.from_numpy(values[None]))[0].numpy().astype("uint8")
classes[~valid] = 255

profile.update(driver="GTiff", count=1, dtype="uint8", nodata=255)
with rasterio.open(vegetation_map, "w", **profile) as dst:
    dst.write(classes, 1)

The GeoTIFF uses BE = 0, NPV = 1, PV = 2 and NoData = 255. For 3D structure, install .[labels3d] and use a separate growth-form GeoTIFF aligned to the LiDAR. This example uses the published growth-form raster codes 0–4.

from hyperFVC.labels3d.projection import transfer_labels

labelled_cloud = transfer_labels(
    labels="growth_forms.tif",
    point_cloud="lidar.laz",
    output="labelled_cloud.laz",
    class_map="paper",
)
print(labelled_cloud.summary())

See the 3D label-transfer input requirements for coordinate systems and height above ground.

Next. Check tensor shapes and class codes in Prepare inputs.

Package | Inputs, classes and settings

Prepare inputs for segmentation

Image tensors

Pass normalized tensors in (batch, bands, height, width) order. Use the checkpoint’s band order and normalization.

Class codes

The three-class presets use BE = 0, NPV = 1 and PV = 2. M3 and M5 provide weights [1, 2, 1] for the loss.

Next. Look up signatures and arguments in the API reference.

Package | API reference

hyperFVC Python API

The main entry points, grouped by task. For a complete example, start with the quick start; for tensor shapes and class codes, see Prepare inputs.

Segmentation and presets

hyperFVC.configs.load_variant

load_variant(name: str) -> dict

Load the model settings and class weights for M1–M5.

hyperFVC.segmentation.unet.UNetModel

UNetModel(in_channels, out_channels, ...)

Build the spectral segmentation network. See Quick start for preset arguments.

Evaluation and deployment

hyperFVC.evaluation.zero_shot.predict_classes

predict_classes(model, images)

Return per-pixel class IDs from semantic logits.

hyperFVC.deployment.export.export_onnx

export_onnx(model, example_input, output_path)

Write an ONNX model with dynamic batch size and the example’s spatial dimensions.

See the package README for spectral layers, losses, fine-tuning and optional 3D label transfer.

How to cite

Cite the study

Use the citation on the EarthArXiv preprint. Cite the Fractional Vegetation Cover Mapping dataset when using the study data.