shireenchand commited on
Commit
beed0b6
·
1 Parent(s): 777a6d2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,7 +1,7 @@
1
  import gradio as gr
2
  import numpy as np
3
  import cv2
4
- from matplotlib import pyplot as plt
5
 
6
  def depthMap(imgL,imgR):
7
  imgL = cv2.cvtColor(imgL, cv2.COLOR_BGR2GRAY)
@@ -14,7 +14,7 @@ def depthMap(imgL,imgR):
14
  stereoMatcher.setSpeckleWindowSize(45)
15
  disparity = stereoMatcher.compute(imgL,imgR)
16
  print(type(disparity))
17
- disparity = cv2.imread(disparity)
18
  return disparity
19
 
20
  leftCam = gr.inputs.Image(shape=(224, 224), source="webcam")
 
1
  import gradio as gr
2
  import numpy as np
3
  import cv2
4
+ from PIL import Image
5
 
6
  def depthMap(imgL,imgR):
7
  imgL = cv2.cvtColor(imgL, cv2.COLOR_BGR2GRAY)
 
14
  stereoMatcher.setSpeckleWindowSize(45)
15
  disparity = stereoMatcher.compute(imgL,imgR)
16
  print(type(disparity))
17
+ disparity = Image.fromarray(disparity)
18
  return disparity
19
 
20
  leftCam = gr.inputs.Image(shape=(224, 224), source="webcam")