imaginaire
imaginaire copied to clipboard
Resolving cv2.imdecode DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
https://github.com/NVlabs/imaginaire/blob/master/imaginaire/datasets/lmdb.py#L66
# Decode and return.
if is_image:
try:
img = cv2.imdecode(np.fromstring(buf, dtype=dtype), mode)
except Exception:
print(path)
# BGR to RGB if 3 channels.
if img.ndim == 3 and img.shape[-1] == 3:
This should become
# Decode and return.
if is_image:
try:
img = cv2.imdecode(np.frombuffer(buf, dtype=dtype), mode)
except Exception:
print(path)
# BGR to RGB if 3 channels.
if img.ndim == 3 and img.shape[-1] == 3:
Thanks, @kingsj0405 !
@arunmallya Could you address the issue?