vahidrezanezhad commited on
Commit
30172d1
·
verified ·
1 Parent(s): 7e6d552

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -39,15 +39,10 @@ def visualize_model_output(prediction, img):
39
  output[:,:,2][prediction[:,:,0]==unq_class] = rgb_class_unique[2]
40
 
41
  output = output.astype(np.uint8)
42
- output_color_coverted = cv2.cvtColor(output, cv2.COLOR_BGR2RGB)
43
- im_pil_output = Image.fromarray(output_color_coverted)
44
 
45
- color_coverted = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
46
- im_pil = Image.fromarray(color_coverted)
47
 
48
- im_pil.paste(im_pil_output, (0,0))
49
-
50
- return im_pil.astype(np.uint8)
51
 
52
 
53
  def do_prediction(model_name, img):
 
39
  output[:,:,2][prediction[:,:,0]==unq_class] = rgb_class_unique[2]
40
 
41
  output = output.astype(np.uint8)
 
 
42
 
43
+ overlayed_image = cv2.addWeighted(img,0.4,output,0.1,0)
 
44
 
45
+ return overlayed_image.astype(np.uint8)
 
 
46
 
47
 
48
  def do_prediction(model_name, img):