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
ModelZoo
DiffBIR_pytorch
Commits
7a5f8d70
Commit
7a5f8d70
authored
Sep 11, 2023
by
zycXD
Browse files
fix bugs
parent
c8c37dbd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
inference_face.py
inference_face.py
+8
-7
No files found.
inference_face.py
View file @
7a5f8d70
...
...
@@ -174,13 +174,14 @@ def main() -> None:
save_restore_path
=
os
.
path
.
join
(
parent_path
,
'restored_faces'
,
save_face_name
)
Image
.
fromarray
(
restored_face
).
save
(
save_restore_path
)
# remove padding
restored_img
=
restored_img
[:
lq_resized
.
height
,
:
lq_resized
.
width
,
:]
# save restored image
if
args
.
resize_back
and
lq_resized
.
size
!=
lq
.
size
:
Image
.
fromarray
(
restored_img
).
resize
(
lq
.
size
,
Image
.
LANCZOS
).
convert
(
"RGB"
).
save
(
restored_img_path
)
else
:
Image
.
fromarray
(
restored_img
).
convert
(
"RGB"
).
save
(
restored_img_path
)
if
not
args
.
has_aligned
:
# remove padding
restored_img
=
restored_img
[:
lq_resized
.
height
,
:
lq_resized
.
width
,
:]
# save restored image
if
args
.
resize_back
and
lq_resized
.
size
!=
lq
.
size
:
Image
.
fromarray
(
restored_img
).
resize
(
lq
.
size
,
Image
.
LANCZOS
).
convert
(
"RGB"
).
save
(
restored_img_path
)
else
:
Image
.
fromarray
(
restored_img
).
convert
(
"RGB"
).
save
(
restored_img_path
)
print
(
f
"Face image
{
basename
}
saved to
{
parent_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