Skip to content
Snippets Groups Projects
Commit 43266831 authored by Nattapon Jaroenchai's avatar Nattapon Jaroenchai
Browse files

Update test_h5image.py

parent 08e5664b
No related branches found
No related tags found
No related merge requests found
......@@ -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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment