fix bug: extension

This commit is contained in:
Xintao
2021-07-28 15:21:47 +08:00
parent da1e1ee805
commit 74fcfea286

View File

@@ -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')
@@ -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}'