瀏覽代碼

fix bug of normalize

jiangjiajun 5 年之前
父節點
當前提交
db6c82530c
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      paddlex/cv/transforms/ops.py

+ 1 - 1
paddlex/cv/transforms/ops.py

@@ -26,7 +26,7 @@ def normalize(im, mean, std, min_value=[0, 0, 0], max_value=[255, 255, 255]):
     # Standardization (Z-score Normalization)
     # Standardization (Z-score Normalization)
     im -= mean
     im -= mean
     im /= std
     im /= std
-    return im
+    return im.astype('float32')
 
 
 
 
 def permute(im, to_bgr=False):
 def permute(im, to_bgr=False):