Ahsen Khaliq commited on
Commit
195971a
1 Parent(s): 387ad5d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -513,6 +513,12 @@ def main(input_path, model_path, output_dir, need_animation=False, resize_h=None
513
  save_all=True, append_images=all_frames[1:], optimize=False, duration=40, loop=0)
514
  return os.path.join(frame_dir, "animation.gif"), tensor_to_pil
515
 
 
 
 
 
 
 
516
  def gradio_inference(image):
517
  return main(input_path=image.name,
518
  model_path='model.pth',
 
513
  save_all=True, append_images=all_frames[1:], optimize=False, duration=40, loop=0)
514
  return os.path.join(frame_dir, "animation.gif"), tensor_to_pil
515
 
516
+ def load_image( infilename ) :
517
+ img = Image.open( infilename )
518
+ img.load()
519
+ data = np.asarray( img, dtype="int32" )
520
+ return data
521
+
522
  def gradio_inference(image):
523
  return main(input_path=image.name,
524
  model_path='model.pth',