Force copy of input img (#297)

pull/298/head
Miguel Mendez 2020-05-24 11:45:21 +02:00 committed by GitHub
parent 02f2573a29
commit fa470ebcef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ def imnormalize(img, mean, std, to_rgb=True):
Returns:
ndarray: The normalized image.
"""
img = np.float32(img) if img.dtype != np.float32 else img.copy()
img = img.copy().astype(np.float32)
return imnormalize_(img, mean, std, to_rgb)