Skip to content

Commit

Permalink
fix bug: extension
Browse files Browse the repository at this point in the history
  • Loading branch information
xinntao committed Jul 28, 2021
1 parent da1e1ee commit 74fcfea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inference_realesrgan.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def main():
default='realesrgan',
help='The upsampler for the alpha channels. Options: realesrgan | bicubic')
parser.add_argument(
'--extension',
'--ext',
type=str,
default='auto',
help='Image extension. Options: auto | jpg | png, auto means using the same extension as inputs')
Expand Down Expand Up @@ -101,10 +101,10 @@ def main():
output_img[:, :, 3] = output_alpha

# ------------------------------ save image ------------------------------ #
if args.extension == 'auto':
if args.ext == 'auto':
extension = extension[1:]
else:
extension == args.extension
extension = args.ext
if img_mode == 'RGBA': # RGBA images should be saved in png format
extension = 'png'
save_path = f'results/{imgname}_{args.suffix}.{extension}'
Expand Down

0 comments on commit 74fcfea

Please sign in to comment.