Kaggle中使用
!pip install git+https://github.com/sberbank-ai/Real-ESRGAN.git
import os
from huggingface_hub import hf_hub_download
import torch
os.environ["HF_ENDPOINT"] = "https://hf-mirror.com"
model_path = hf_hub_download(repo_id="Shandypur/ESRGAN-4x-UltraSharp", filename="4x-UltraSharp.pth", repo_type="model")
weights = torch.load(model_path)
map_key = [
["conv_body", "sub.23"],
["body", "sub"],
["rdb", "RDB"],
["", "model.1."],
["conv_first", "model.0"],
["conv_up1", "model.3"],
["conv_up2", "model.6"],
["conv_hr", "model.8"],
[