align_convnextv2 / README.md
f-fuchs's picture
Upload decoder-only weights under CC BY-NC 4.0
6fc7fa9 verified
|
Raw History Blame Contribute Delete
3.61 kB
---
license: cc-by-nc-4.0
license_link: https://creativecommons.org/licenses/by-nc/4.0/
model_creator: "Fabian Fuchs"
tags:
- seismic
- decoder-only
- image-to-image
---
# f-fuchs/align_convnextv2
This repository contains **trained decoder weights only** for a seismic
encoder-decoder model. No pretrained encoder weights are included.
- Decoder: `UNetDecoder`
- Encoder configuration: `CONVNEXTV2_BASE`
- Training mode: `LINEAR_PROBING`
- Attribution: Fabian Fuchs, `f-fuchs/align_convnextv2` (cite the checkpoint revision used).
## License and third-party encoder weights
The **decoder weights in `model.safetensors`** are licensed under
[Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)](https://creativecommons.org/licenses/by-nc/4.0/).
You must provide appropriate credit, link to the license, indicate changes,
and comply with its noncommercial restriction and all other terms.
The [legal code](https://creativecommons.org/licenses/by-nc/4.0/legalcode) controls; this summary is not a substitute.
See `LICENSE.md`.
**This license applies only to the decoder weights.** It does not relicense
any encoder weights, architecture, third-party software, or datasets.
Pretrained encoder weights are obtained separately from their original source
when the model is recreated (downloaded by the configured timm/Transformers
loader if not cached). Custom encoders may require a separately acquired
checkpoint. Their original licenses, attribution requirements, access
conditions, and use restrictions remain in force. Users must review and comply
with the terms of the specific encoder checkpoint and any other dependencies;
a software library's license is not necessarily the encoder weights' license.
A private repository does not waive these obligations. No permission for
commercial use of the combined model is granted here.
## Recreate the model
Install this project's `foundation_models` package and its dependencies in a
compatible environment. Authenticate with `hf auth login` using an account
with access to this private repository. The following follows the loading
pattern in `scripts/inference.py`; **it may download encoder weights separately**.
The decoder is not a standalone Transformers `AutoModel` checkpoint.
```python
from ast import literal_eval
from huggingface_hub import hf_hub_download
from safetensors import safe_open
from foundation_models.utils import build_model
path = hf_hub_download(repo_id='f-fuchs/align_convnextv2', filename="model.safetensors")
with safe_open(path, framework="pt", device="cpu") as checkpoint:
config = literal_eval(checkpoint.metadata()["config"])
model_config = config["encoder_decoder"]
model_config.update(
checkpoint=path, mode="INFERENCE", device="cpu", optimization=None
)
modifications = model_config["backbone"].get("modifications", {})
for key in ("input_size", "patch_size", "window_size", "down_sampling_rates", "n_channels"):
if isinstance(modifications.get(key), list):
modifications[key] = tuple(modifications[key])
model, device, _ = build_model(config=model_config)
model.eval()
```
The checkpoint retains the decoder/encoder reconstruction settings and, when
available, training transform configuration in `config["data"]["transforms"]`.
Apply the appropriate inference preprocessing; training augmentations should
not be applied blindly during inference. Local dataset paths and unrelated
training metadata are not included. Encoder sources are resolved using the
installed project's backbone definitions; use the matching code and dependency
versions for reproducibility.