|
import torch |
|
from basicsr.models.archs.histoformer_arch import Histoformer |
|
from huggingface_hub import PyTorchModelHubMixin |
|
from huggingface_hub import hf_hub_download |
|
|
|
model = Histoformer() |
|
|
|
|
|
filepath = hf_hub_download(repo_id="sunsean/Histoformer", filename="Allweather/pretrained_models/net_g_real.pth") |
|
print(filepath) |
|
model.load_state_dict(torch.load(filepath, map_location='cpu')['params'], ) |
|
|
|
|
|
model.push_to_hub("sunsean/Histoformer-real") |
|
|
|
|
|
model = Histoformer.from_pretrained("sunsean/Histoformer-real") |