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

Update test_h5image.py

parent 71048505
No related branches found
No related tags found
1 merge request!1updated main for release
Pipeline #2489 canceled
from data_util import DataLoader
from h5Image import H5Image
import random
# Load the HDF5 file using the H5Image class
h5_image = H5Image('/projects/bbym/shared/data/commonPatchData/256/AZ_Tucson.hdf5', mode='r')
# Get the size of the map
map_width, map_height = h5_image.get_map_size('map')
print(map_width, map_height)
# # Calculate the number of patches based on the patch size and border
# num_rows = math.ceil(map_width / h5_image.patch_size)
# num_cols = math.ceil(map_height / h5_image.patch_size)
\ No newline at end of file
maps = h5_image.get_maps()
print(len(maps))
map = random.choice(maps)
layers = h5_image.get_layers(map)
print(map, len(layers))
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