"...user_guide/git@developer.sourcefind.cn:wangsen/mineru.git" did not exist on "cf6fa1276743ed7089a32ab2b0a77777bb7c7884"
Unverified Commit f71dd253 authored by Maksim Skobeev's avatar Maksim Skobeev Committed by GitHub
Browse files

Update model.py

parent 46f5930b
......@@ -4,7 +4,7 @@ from torch.nn import functional as F
from PIL import Image
import numpy as np
import cv2
from huggingface_hub import hf_hub_url, hf_hub_download
from huggingface_hub import hf_hub_url, hf_hub_download, cached_download
from .rrdbnet_arch import RRDBNet
from .utils import pad_reflect, split_image_into_overlapping_patches, stich_together, \
......@@ -43,7 +43,8 @@ class RealESRGAN:
cache_dir = os.path.dirname(model_path)
local_filename = os.path.basename(model_path)
config_file_url = hf_hub_url(repo_id=config['repo_id'], filename=config['filename'])
hf_hub_download(repo_id=config['repo_id'], cache_dir=cache_dir, filename=config['filename'])
hf_hub_download(repo_id=config['repo_id'], filename=config['filename'])
# cached_download(config_file_url, cache_dir=cache_dir, force_filename=local_filename)
print('Weights downloaded to:', os.path.join(cache_dir, local_filename))
loadnet = torch.load(model_path)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment