Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
Real-ESRGAN
Commits
f71dd253
Unverified
Commit
f71dd253
authored
Dec 26, 2023
by
Maksim Skobeev
Committed by
GitHub
Dec 26, 2023
Browse files
Update model.py
parent
46f5930b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
RealESRGAN/model.py
RealESRGAN/model.py
+3
-2
No files found.
RealESRGAN/model.py
View file @
f71dd253
...
@@ -4,7 +4,7 @@ from torch.nn import functional as F
...
@@ -4,7 +4,7 @@ from torch.nn import functional as F
from
PIL
import
Image
from
PIL
import
Image
import
numpy
as
np
import
numpy
as
np
import
cv2
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
.rrdbnet_arch
import
RRDBNet
from
.utils
import
pad_reflect
,
split_image_into_overlapping_patches
,
stich_together
,
\
from
.utils
import
pad_reflect
,
split_image_into_overlapping_patches
,
stich_together
,
\
...
@@ -43,7 +43,8 @@ class RealESRGAN:
...
@@ -43,7 +43,8 @@ class RealESRGAN:
cache_dir
=
os
.
path
.
dirname
(
model_path
)
cache_dir
=
os
.
path
.
dirname
(
model_path
)
local_filename
=
os
.
path
.
basename
(
model_path
)
local_filename
=
os
.
path
.
basename
(
model_path
)
config_file_url
=
hf_hub_url
(
repo_id
=
config
[
'repo_id'
],
filename
=
config
[
'filename'
])
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
))
print
(
'Weights downloaded to:'
,
os
.
path
.
join
(
cache_dir
,
local_filename
))
loadnet
=
torch
.
load
(
model_path
)
loadnet
=
torch
.
load
(
model_path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment