Instructions to use benfox6515/TerraHeight-S with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- DepthAnythingV2
How to use benfox6515/TerraHeight-S with DepthAnythingV2:
# Install from https://github.com/DepthAnything/Depth-Anything-V2 # Load the model and infer depth from an image import cv2 import torch from depth_anything_v2.dpt import DepthAnythingV2 # instantiate the model model = DepthAnythingV2(encoder="<ENCODER>", features=<NUMBER_OF_FEATURES>, out_channels=<OUT_CHANNELS>) # load the weights filepath = hf_hub_download(repo_id="benfox6515/TerraHeight-S", filename="depth_anything_v2_<ENCODER>.pth", repo_type="model") state_dict = torch.load(filepath, map_location="cpu") model.load_state_dict(state_dict).eval() raw_img = cv2.imread("your/image/path") depth = model.infer_image(raw_img) # HxW raw depth map in numpy - Notebooks
- Google Colab
- Kaggle
TerraHeight-S
TerraHeight-S is a compact remote-sensing height estimation model for predicting dense per-pixel Above Ground Level (AGL) height maps from overhead RGB imagery.
The model was created by fine-tuning the pretrained Depth Anything V2 Small (ViT-S) model exclusively on the GAMUS dataset.
TerraHeight-S contains only 24.79M parameters while achieving performance competitive with substantially larger state-of-the-art height estimation models.
Model Details
| Property | TerraHeight-S |
|---|---|
| Task | Single-view remote-sensing height estimation |
| Input | Overhead RGB imagery |
| Output | Dense height map |
| Output units | Metres Above Ground Level (AGL) |
| Training dataset | GAMUS |
| Backbone | Depth Anything V2 Small |
| Encoder | ViT-S |
| Parameters | 24,785,089 |
| Feature dimension | 64 |
| Decoder channels | 48, 96, 192, 384 |
| Training crop size | 630 ร 630 |
| Best checkpoint epoch | 30 |
| Test-time augmentation | None |
Validation Performance
The released checkpoint achieved the following results on the held-out GAMUS validation data.
| Height Range | MAE โ | RMSE โ | Pearson Correlation โ |
|---|---|---|---|
| All pixels | 1.312 m | 2.616 m | 0.9238 |
| > 1 m | 2.421 m | 3.569 m | 0.8923 |
| > 5 m | 2.693 m | 3.951 m | 0.8758 |
The overall evaluation covered approximately 900.7 million valid pixels.
Comparison with Depth2Elevation
Depth2Elevation is a published state-of-the-art reference for single-view remote-sensing height estimation on GAMUS.
Using the GAMUS test benchmark, the following results provide a useful comparison:
| Model | Parameters | MAE โ | RMSE โ |
|---|---|---|---|
| Depth2Elevation | 99.54M | 1.991 m | 3.489 m |
| TerraHeight-S | 24.79M | 1.580 m | 3.725 m |
TerraHeight-S achieves a lower MAE while remaining close in RMSE, despite using approximately 4ร fewer parameters.
This represents roughly a 75% reduction in parameter count compared with Depth2Elevation.
Architecture
TerraHeight-S is based on the pretrained Depth Anything V2 Small architecture.
Rather than training a vision transformer from scratch, the pretrained representation learned by Depth Anything V2 is fine-tuned for remote-sensing metric height estimation using GAMUS RGB imagery and corresponding AGL targets.
The released model configuration is:
Encoder: ViT-S
Features: 64
Out channels: [48, 96, 192, 384]
Parameters: 24.79M
- Downloads last month
- -