zhiweili commited on
Commit
42986a1
1 Parent(s): afb254c

p2p add download_path

Browse files
Files changed (1) hide show
  1. app_haircolor_pix2pix.py +3 -3
app_haircolor_pix2pix.py CHANGED
@@ -59,10 +59,9 @@ def image_to_image(
59
 
60
  run_task_time, time_cost_str = get_time_cost(run_task_time, time_cost_str)
61
  enhanced_image = enhance_image(generated_image, False)
 
62
  return enhanced_image, time_cost_str
63
 
64
- return generated_image, time_cost_str
65
-
66
  def get_time_cost(run_task_time, time_cost_str):
67
  now_time = int(time.time()*1000)
68
  if run_task_time == 0:
@@ -98,6 +97,7 @@ def create_demo() -> gr.Blocks:
98
  input_image = gr.Image(label="Input Image", type="pil")
99
  with gr.Column():
100
  restored_image = gr.Image(label="Restored Image", type="pil", interactive=False)
 
101
  with gr.Column():
102
  origin_area_image = gr.Image(label="Origin Area Image", type="pil", interactive=False)
103
  generated_image = gr.Image(label="Generated Image", type="pil", interactive=False)
@@ -114,7 +114,7 @@ def create_demo() -> gr.Blocks:
114
  ).success(
115
  fn=restore_result,
116
  inputs=[croper, category, generated_image],
117
- outputs=[restored_image],
118
  )
119
 
120
  return demo
 
59
 
60
  run_task_time, time_cost_str = get_time_cost(run_task_time, time_cost_str)
61
  enhanced_image = enhance_image(generated_image, False)
62
+ run_task_time, time_cost_str = get_time_cost(run_task_time, time_cost_str)
63
  return enhanced_image, time_cost_str
64
 
 
 
65
  def get_time_cost(run_task_time, time_cost_str):
66
  now_time = int(time.time()*1000)
67
  if run_task_time == 0:
 
97
  input_image = gr.Image(label="Input Image", type="pil")
98
  with gr.Column():
99
  restored_image = gr.Image(label="Restored Image", type="pil", interactive=False)
100
+ download_path = gr.File(label="Download the output image", interactive=False)
101
  with gr.Column():
102
  origin_area_image = gr.Image(label="Origin Area Image", type="pil", interactive=False)
103
  generated_image = gr.Image(label="Generated Image", type="pil", interactive=False)
 
114
  ).success(
115
  fn=restore_result,
116
  inputs=[croper, category, generated_image],
117
+ outputs=[restored_image, download_path],
118
  )
119
 
120
  return demo