RCAN-DSC (4× Downscaling of Wind Velocities)
This model is a custom-trained version of the RCAN model from the super-image
library.
It is adapted for downscaling of 2-channel ERA5 data (e.g., wind u and v components), by a factor of 4× (trained using COSMO-REA6 as high-resolution data).
🧠Model Description
- Based on the original RCAN architecture from
super-image
. sub_mean
andadd_mean
normalization layers have been removed- Supports multi-channel inputs, currently set up for 2-channel wind velocity fields.
🧪 Example
from super_image import RcanModel, RcanConfig
from huggingface_hub import hf_hub_download
import torch
# load model
path = hf_hub_download(repo_id="lschmidt/rcan-dsc", filename="rcan_model.py")
exec(open(path).read())
model = load_rcan()
# load config
config, _ = RcanConfig.from_pretrained("lschmidt/rcan-dsc")
# load pretrained weights
state_dict_path = hf_hub_download(repo_id="lschmidt/rcan-dsc", filename="pytorch_model_4x.pt")
state_dict = torch.load(state_dict_path, map_location="cpu")
model.load_state_dict(state_dict, strict=False)
# generate sample data (B, C, W, H)
inputs = torch.randn(1, 2, 10, 10)
# or use test data
data_path = hf_hub_download(
repo_id="lschmidt/rcan-dsc",
filename="test_wind_velocities.nc",
subfolder="test_data"
)
ds = xr.open_dataset(data_path)
u = ds["u100"].values[0]
v = ds["v100"].values[0]
inputs = torch.from_numpy(np.stack([u, v], axis=0)).unsqueeze(0).float()
# prediction
output = model(inputs)
- Downloads last month
- 43
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
🙋
Ask for provider support