Rodrigo_Cobo commited on
Commit
fcda6f5
1 Parent(s): eac489d

fix jpeg error

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -3,9 +3,8 @@ import gradio as gr
3
  import cv2
4
  import torch
5
  import urllib.request
6
- from PIL import Image
7
-
8
  import matplotlib.pyplot as plt
 
9
 
10
  def update(slider, img):
11
 
@@ -50,7 +49,8 @@ def update(slider, img):
50
  #out_im = Image.fromarray(output)
51
  #out_im.convert('RGB').save("temp/image_depth.jpeg", "JPEG")
52
 
53
- cv2.imwrite("temp/image_depth.jpeg", output)
 
54
 
55
  return f'temp/image_depth.jpeg'
56
 
 
3
  import cv2
4
  import torch
5
  import urllib.request
 
 
6
  import matplotlib.pyplot as plt
7
+ from PIL import Image
8
 
9
  def update(slider, img):
10
 
 
49
  #out_im = Image.fromarray(output)
50
  #out_im.convert('RGB').save("temp/image_depth.jpeg", "JPEG")
51
 
52
+ #cv2.imwrite("temp/image_depth.jpeg", output)
53
+ plt.imsave('test.png', output)
54
 
55
  return f'temp/image_depth.jpeg'
56