Xuban's picture
Add LibreSwinIRl-restore (converted official SwinIR, Apache-2.0)
376de63 verified
|
Raw History Blame Contribute Delete
1.57 kB
---
license: apache-2.0
library_name: libreyolo
tags:
- super-resolution
- image-to-image
- swinir
pipeline_tag: image-to-image
---
# LibreSwinIRl-restore
SwinIR-L x4 real-world super-resolution (large GAN generator), repackaged for LibreYOLO.
## Source
Weights derived from [JingyunLiang/SwinIR](https://github.com/JingyunLiang/SwinIR)
release `003_realSR_BSRGAN_DFOWMFC_s64w8_SwinIR-L_x4_GAN.pth`
(SHA-256 `99adfa91350a84c99e946c1eb3d8fce34bc28f57d807b09dc8fe40a316328c0a`).
Copyright (c) 2021 Jingyun Liang. Licensed under the Apache License, Version 2.0.
Architecture reference commit: `6545850fbf8df298df73d81f3e8cba638787c8bd`.
## Modifications
State-dict metadata-wrap only: keys and learned parameters are unchanged; the
checkpoint is wrapped in the LibreYOLO v1.0 schema (`task=restore`, `scale=4`).
Tensor-level parity vs the official model is exact (`max_abs_diff == 0`, fp32).
Converted with `weights/convert_swinir_weights.py` from the
[LibreYOLO source repository](https://github.com/LibreYOLO/libreyolo)
(converted-file SHA-256 `373e2397ab8c8fc71308808683da025e98c5f845ea7588e3f65009a516ed985e`).
## Usage
```python
from libreyolo import LibreYOLO
model = LibreYOLO("LibreSwinIRl-restore.pt")
res = model.predict("small.jpg") # res.restored is 4x the input
res.save("upscaled.png")
# large images: model.predict("big.jpg", tile=256) # halo-padded tiling
```
## License
Apache-2.0 (code and weights). See the [`LICENSE`](./LICENSE) and
[`NOTICE`](./NOTICE) files in this repository.