sariyam commited on
Commit
00cae0f
·
verified ·
1 Parent(s): 3638486
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -18,19 +18,19 @@ def color(image):
18
  result = output[OutputKeys.OUTPUT_IMG].astype(np.uint8)
19
  # result = result[...,::-1]
20
  # Generate a unique filename using UUID
21
- unique_imgfilename = str(uuid.uuid4()) + '.png'
22
  cv2.imwrite(unique_imgfilename, result)
23
  print('infer finished!')
24
  return (image, unique_imgfilename) , unique_imgfilename
25
 
26
 
27
- title = "Colorize Black and White Photos Online"
28
  description = "Use AI image coloring algorithm to easily colorize your old black and white photos instead of traditional color filters."
29
  slider = ImageSlider(position=0.5,label='Original vs AI Processed')
30
  download_button = gr.File(label="Download")
31
  examples = [['./input.jpg'],]
32
 
33
- demo = gr.Interface(fn=color,inputs="image",outputs=[slider,download_button],examples=examples,title=title,description=description)
34
 
35
  if __name__ == "__main__":
36
- demo.launch(share=False)
 
18
  result = output[OutputKeys.OUTPUT_IMG].astype(np.uint8)
19
  # result = result[...,::-1]
20
  # Generate a unique filename using UUID
21
+ unique_imgfilename = 'colorize_'+str(uuid.uuid4()) + '.png'
22
  cv2.imwrite(unique_imgfilename, result)
23
  print('infer finished!')
24
  return (image, unique_imgfilename) , unique_imgfilename
25
 
26
 
27
+ title = "Colorize Black and White Photos"
28
  description = "Use AI image coloring algorithm to easily colorize your old black and white photos instead of traditional color filters."
29
  slider = ImageSlider(position=0.5,label='Original vs AI Processed')
30
  download_button = gr.File(label="Download")
31
  examples = [['./input.jpg'],]
32
 
33
+ demo = gr.Interface(fn=color,inputs="image",outputs=[slider,download_button],examples=examples,title=title,description='')
34
 
35
  if __name__ == "__main__":
36
+ demo.launch(show_error=True)