k-kotetsu commited on
Commit
58e1239
·
1 Parent(s): a99c2b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -115,11 +115,11 @@ def realesrgan(img, model_name, denoise_strength, face_enhance, outscale, ext):
115
 
116
  #out_filename = f"output_{rnd_string(8)}.{extension}"
117
  out_filename = f"output_{rnd_string(8)}." + ext
118
- if parameters != '':
119
- metadata = PngInfo()
120
- metadata.add_text("parameters", parameters)
121
- cv2.imwrite(out_filename, output, [int(cv2.IMWRITE_PNG_COMPRESSION), 0], pnginfo=metadata)
122
- else:
123
  cv2.imwrite(out_filename, output)
124
  global last_file
125
  last_file = out_filename
@@ -215,7 +215,7 @@ def main():
215
  with gr.Group():
216
  input_image = gr.Image(label="Source Image", type="pil", image_mode="RGBA")
217
  input_image_properties = gr.Textbox(label="Image Properties", max_lines=1)
218
- input_image_metadata = gr.Textbox(label="Image Metadata", max_lines=1)
219
  output_image = gr.Image(label="Restored Image", image_mode="RGBA", show_share_button=False)
220
  with gr.Row():
221
  restore_btn = gr.Button("Upscale")
 
115
 
116
  #out_filename = f"output_{rnd_string(8)}.{extension}"
117
  out_filename = f"output_{rnd_string(8)}." + ext
118
+ #if parameters != '':
119
+ # metadata = PngInfo()
120
+ # metadata.add_text("parameters", parameters)
121
+ # cv2.imwrite(out_filename, output, [int(cv2.IMWRITE_PNG_COMPRESSION), 0], pnginfo=metadata)
122
+ #else:
123
  cv2.imwrite(out_filename, output)
124
  global last_file
125
  last_file = out_filename
 
215
  with gr.Group():
216
  input_image = gr.Image(label="Source Image", type="pil", image_mode="RGBA")
217
  input_image_properties = gr.Textbox(label="Image Properties", max_lines=1)
218
+ #input_image_metadata = gr.Textbox(label="Image Metadata", max_lines=1)
219
  output_image = gr.Image(label="Restored Image", image_mode="RGBA", show_share_button=False)
220
  with gr.Row():
221
  restore_btn = gr.Button("Upscale")