Skip to content
Other

DEM-SR

повышение разрешения карт рельефа в 3 раза

2 min readupdated

Набор из двух моделей машинного обучения от автора Ichigo369 для задач геоинформатики и дистанционного зондирования Земли. Они решают задачу суперразрешения (super-resolution): берут цифровую модель рельефа (DEM) с шагом 30 метров из базы NASADEM, добавляют к ней спутниковый RGB-снимок Sentinel-2 и превращают в детализированную карту высот с шагом 10 метров (одна ячейка 30×30 м делится на девять 10×10 м). В репозитории лежат два варианта архитектуры на базе U-Net: детерминированная ResUNet-SR (17,8M параметров) и генеративная RFVelocityUNet (42,8M параметров) на основе Rectified Flow (метода генерации через выпрямленные потоки). В отличие от простой бикубической интерполяции, нейросети предсказывают уточняющие детали рельефа с опорой на реальные оптические снимки местности.

Ключевые особенности

  • Две архитектуры на выбор: лёгкая детерминированная unet_b64 (272 МБ) с функцией потерь L1 + контроль уклона и более тяжёлая rf_b64 (653 МБ) с поддержкой CFG (classifier-free guidance — настройки силы следования условию).
  • Обучение на реальных данных: модели тренировались на 67 462 парных фрагментах размером 240×240 пикселей из 40 регионов Высокогорной Азии (горы, хребты, холмы и равнины).
  • Удобный формат весов: чекпоинты ckpt_best.pt содержат усреднённые веса EMA и словарь параметров args, поэтому архитектура восстанавливается автоматически без жёсткой привязки к коду.

Что можно сделать

  • Детализировать 30-метровые карты высот NASADEM до 10-метрового формата GeoTIFF с сохранением геопривязки (CRS) через скрипт predict_sr.py.
  • Сравнить на своих геоданных классическую регрессию (ResUNet-SR) и генеративный подход Rectified Flow, подбирая параметр guidance и число шагов NFE.
  • Дообучить модели с последнего шага (ckpt_last.pt) под другой регион или тип ландшафта на видеокарте уровня RTX 4060 с 8 ГБ VRAM.

Пример

import torch
from models_sr import ResUNetSR

ckpt = torch.load("unet_b64/ckpt_best.pt", map_location="cpu", weights_only=False)
unet = ResUNetSR(ckpt["args"]["base"])
unet.load_state_dict(ckpt["ema"])
unet.to("cuda").eval()
ПодробнееНа тестовой выборке (256 фрагментов) unet_b64 показала RMSE 4,073 м, MAE 3,033 м и PSNR 41,27 дБ (у бикубической интерполяции — RMSE 7,199 м и PSNR 35,89 дБ), у rf_b64 — RMSE 5,085 м и PSNR 39,45 дБ.
Обучались на одной видеокарте RTX 4060 (8 ГБ) с жёстким лимитом в 7,5 ГБ VRAM.
Ограничения: обучение остановлено до завершения полного бюджета шагов (46k/50k для U-Net и 64k/80k для RF), модели заточены только под Высокогорную Азию (система координат ESRI:102008, высоты EGM96), лицензия на коммерческое использование не предоставлена.
Discuss Telegram 0

Will it run?

Runs in BF16

Fits without quantisation.

  • BF16weights 0.6 GB · ready files1.2 GB
  • FP8 / INT8recommendedweights 0.3 GB0.9 GB
  • 4-bitweights 0.2 GB0.7 GB

Tip: go 8-bit.FP8 / INT8 is within about a percent of full precision in quality, takes half the memory and runs faster on RTX 40/50 and H100. Full precision only pays off for fine-tuning.

What to get for this model

Massed ComputeOpen Massed Compute

Your own GPU: FP8 / INT8 — from RTX 2060 · BF16 — from RTX 2060

Massed Compute hourly prices, November 2026. The discounted price applies with the coupon at checkout.

Estimate: weights plus working memory. Long videos, high resolutions and long contexts need more.

Run it on Massed Compute

The script downloads the model to the rented machine. How to run it is in the model card.

  1. 1. Rent a machine with a fitting GPU

    Open Massed Compute
  2. 2. Paste the script into the machine's terminal

    Connect over SSH (the Massed Compute panel shows the command) or open a terminal on the machine's desktop.

    HF_TOKEN / CIVITAI_TOKENThe script starts with token lines: paste yours between the quotes. The Hugging Face token is for gated models, the Civitai one for Civitai models.

    # Ichigo369/dem-sr-models
    mkdir -p ~/models
    curl -LsSf https://astral.sh/uv/install.sh | sh
    source "$HOME/.local/bin/env"
    uv tool install "huggingface_hub[cli]"
    hf download Ichigo369/dem-sr-models --local-dir ~/models/dem-sr-models
    # The model is in ~/models. How to run it is in the model card (link above).
    Add more LoRAs to dem-sr-models
  3. 3. Use it

    The model is in ~/models. How to run it is in the model card (link above).

Stop the machine in the panel when you are done: it bills by the minute while it runs.

How to speed it up

Picked for this model type. Choose your hardware above to see what fits you exactly.

  • FlashAttention 44.0.0b40from November 18, 2026new release

    fastest exact attention on B200

    Kernels for Blackwell (beta). Exact attention without quantisation — fine for everything, LLMs included.

    How to enable: pip install flash-attn-4; vLLM and SGLang pick it up themselves.

    Earlier generations (2)
    • FlashAttention 3 — The Hopper (H100/H200) version with FP8.
    • FlashAttention 2 — The standard for RTX 30/40/50 and A100: exact attention without the memory cost of long contexts.
  • torch.compile2.15.0from October 28, 2026new release

    10–30% for free

    Compiles the model for your GPU. Slower first run, faster afterwards.

    How to enable: model = torch.compile(model); in ComfyUI the TorchCompileModel node.

Model family

New posts about versions of dem-sr-models (quants, finetunes, LoRAs) will show up under the bell.

No known relatives of this model yet. All derivatives on Hugging Face

About the model

Ichigo369/dem-sr-models
Author
Ichigo369
Category
Other
Released
Posted

On NeyroLearn

Hugging Face

00

Ask AI about this model

Answered by Gemini 4 · the chat is kept only in this tab

Comments

Other

Tell v2

Tell v2