diff --git a/test_h5image.py b/test_h5image.py index 75ce617230d9312683fc4bb3bea37f80a7ff745b..52b6d3899c3327377a803f6cc5c28161c9634fd8 100644 --- a/test_h5image.py +++ b/test_h5image.py @@ -3,7 +3,7 @@ import cv2 import tensorflow as tf import matplotlib.pyplot as plt import numpy as np -import rasterios +import rasterio # Load the HDF5 file using the H5Image class print("Loading the HDF5 file.") @@ -21,7 +21,7 @@ if dset.ndim == 3: image = dset[...].transpose(2, 0, 1) # rasterio expects bands first else: image = np.array(dset[...], ndmin=3) -rasterios.open(f"/projects/bbym/nathanj/attentionUnet/infer_results/{map_name}.tif", 'w', driver='GTiff', compress='lzw', +rasterio.open(f"/projects/bbym/nathanj/attentionUnet/infer_results/{map_name}.tif", 'w', driver='GTiff', compress='lzw', height=image.shape[1], width=image.shape[2], count=image.shape[0], dtype=image.dtype, crs=h5_image.get_crs(map_name, legend), transform=h5_image.get_transform(map_name, legend)).write(image)