zhigangjiang commited on
Commit
4def7cc
1 Parent(s): 910b004

Update visualization/grad.py

Browse files
Files changed (1) hide show
  1. visualization/grad.py +2 -2
visualization/grad.py CHANGED
@@ -22,7 +22,7 @@ def convert_img(value, h, need_nor=True, cmap=None):
22
  elif cmap == cv2.COLORMAP_PLASMA:
23
  grad_img = cv2.applyColorMap((grad_img * 255).astype(np.uint8), colormap=cmap)
24
  grad_img = grad_img[..., ::-1]
25
- grad_img = grad_img.astype(np.float) / 255.0
26
  elif cmap == 'HSV':
27
  grad_img = np.round(grad_img * 1000) / 1000.0
28
  grad_img = grad_img[..., np.newaxis].repeat(3, axis=-1)
@@ -31,7 +31,7 @@ def convert_img(value, h, need_nor=True, cmap=None):
31
  grad_img[..., 2] = 255
32
  grad_img = grad_img.astype(np.uint8)
33
  grad_img = cv2.cvtColor(grad_img, cv2.COLOR_HSV2RGB)
34
- grad_img = grad_img.astype(np.float) / 255.0
35
  return grad_img
36
 
37
 
 
22
  elif cmap == cv2.COLORMAP_PLASMA:
23
  grad_img = cv2.applyColorMap((grad_img * 255).astype(np.uint8), colormap=cmap)
24
  grad_img = grad_img[..., ::-1]
25
+ grad_img = grad_img.astype(np.float32) / 255.0
26
  elif cmap == 'HSV':
27
  grad_img = np.round(grad_img * 1000) / 1000.0
28
  grad_img = grad_img[..., np.newaxis].repeat(3, axis=-1)
 
31
  grad_img[..., 2] = 255
32
  grad_img = grad_img.astype(np.uint8)
33
  grad_img = cv2.cvtColor(grad_img, cv2.COLOR_HSV2RGB)
34
+ grad_img = grad_img.astype(np.float32) / 255.0
35
  return grad_img
36
 
37