🤗 Demo | 📦 Model | 🗂️ Dataset
Find where super-resolution goes wrong and which artifacts appear
Try our hosted demo on Hugging Face. The demo compares RealESRGAN and SwinIR on examples with texture hallucinations, stripe-like pattern artifacts, and blur-like surface defects.
To run the project locally, install the package first:
pip3 install git+https://github.com/msu-video-group/srflawscryThen launch the interface:
python3 -m srflawscryuiIt will automatically download our demo dataset and model. To use your own
images, put them into assets/data folder with this structure:
assets/data/
MyMethod/
sources/<item_id>
results/<item_id>
where the sources folder contains the original low-resolution inputs and the
results folder contains the 4x-upscaled images with matching file names.
Metric computation is supported on CPUs, Apple Silicon Macs, and CUDA-capable GPUs.
At least 3 GB of VRAM is recommended for GPU inference.
Our artifact detection metric is called WASD. You can easily add it to your project with the following snippet:
from pathlib import Path
from srflawscry import WASD
model = WASD.from_pretrained("egorchistov/sr-artifact-detection-wasd").eval()
model.run(
image_path=Path("result.png"),
source_path=Path("source.png"),
output_path=Path("artifact_mask.png"),
)For local development, you need the full installation:
git clone https://github.com/msu-video-group/srflawscry.git
cd srflawscry
pip3 install --editable .[dev]
pre-commit installYou can extend this repository in many ways. For example, if you want to add a
simple scalar metric such as LPIPS or MANIQA, create a metric class that
returns one number per image and add it to default_config(). If the metric also
produces a heatmap or mask, save it in outputs/ so the UI can display it beside
the compared images.
FolderWithSourcesLayout
│
▼
Sample(item_id, result_path, source_path)
│
▼
Metric.evaluate(sample) ──► numbers in metrics.csv
│
└───────────────► optional masks in outputs/
Feel free to open an issue if you have any questions.