vahidrezanezhad commited on
Commit
05292fd
·
verified ·
1 Parent(s): 858ba25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -8
app.py CHANGED
@@ -41,15 +41,9 @@ def visualize_model_output(prediction, img):
41
  output = output.astype(np.int8)
42
  img = img.astype(np.int8)
43
 
44
- bg_img = img.copy()
45
- shapes = np.zeros_like(img, np.uint8)
46
- shapes = output
47
- mask = shapes.astype(bool)
48
- alpha = 0.5
49
- bg_img[mask] = cv2.addWeighted(bg_img, 1 - alpha, shapes, alpha, 0)[mask]
50
-
51
 
52
- return bg_img
53
 
54
 
55
  def do_prediction(model_name, img):
 
41
  output = output.astype(np.int8)
42
  img = img.astype(np.int8)
43
 
44
+ added_image = cv2.addWeighted(img,0.4,output,0.1,0)
 
 
 
 
 
 
45
 
46
+ return added_image
47
 
48
 
49
  def do_prediction(model_name, img):