You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
frombuilding_footprint_segmentation.helpers.callbacksimportCallbackList, TensorBoardCallbackwhere_to_log_the_callback=r"path_to_log_callback"callbacks=CallbackList()
# Ouptut from all the callbacks caller will be stored at the path specified in log_dircallbacks.append(TensorBoardCallback(where_to_log_the_callback))
To view Tensorboard dash board
tensorboard --logdir="path_to_log_callback"
Defining Custom Callback
frombuilding_footprint_segmentation.helpers.callbacksimportCallbackList, CallbackclassCustomCallback(Callback):
def__init__(self, log_dir):
super().__init__(log_dir)
where_to_log_the_callback=r"path_to_log_callback"callbacks=CallbackList()
# Ouptut from all the callbacks caller will be stored at the path specified in log_dircallbacks.append(CustomCallback(where_to_log_the_callback))
Split the images in smaller sample
importglobimportosfromimage_fragment.fragmentimportImageFragment# FOR .jpg, .png, .jpegfromimageioimportimread, imsave# FOR .tifffromtifffileimportimread, imsaveORIGINAL_DIM_OF_IMAGE= (1500, 1500, 3)
CROP_TO_DIM= (384, 384, 3)
image_fragment=ImageFragment.image_fragment_3d(
fragment_size=(384, 384, 3), org_size=ORIGINAL_DIM_OF_IMAGE
)
IMAGE_DIR=r"pth\to\input\dir"SAVE_DIR=r"pth\to\save\dir"forfileinglob.glob(
os.path.join(IMAGE_DIR, "*")
):
image=imread(file)
fori, fragmentinenumerate(image_fragment):
# GET DATA THAT BELONGS TO THE FRAGMENTfragmented_image=fragment.get_fragment_data(image)
imsave(
os.path.join(
SAVE_DIR,
f"{i}_{os.path.basename(file)}",
),
fragmented_image,
)