Evaluate an EventNet Model#

Imports#

[ ]:
import os
import matplotlib.pyplot as plt

os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"

plt.rcParams["figure.figsize"] = (16, 8)

from insar_eventnet import inference

Initialize Input Variables#

In order to evaluate the model, we need a dataset made up of real interferogram examples with positives containing deformation events, and negatives containing no deformation events. The test_model function expects the dataset to be a directory which contains two directories called “Positives” and “Negatives” which contain their respective wrapped or unwrapped tifs. The tifs should be named as they are from ASF’s products.

Example_Dataset_Directory:   Positives     S1AA_20170313T015539_20170406T015540_VVP024_INT80_G_ueF_4F40_unw_phase.tif     S1AA_20211113T141718_20211125T141717_VVP012_INT80_G_ueF_AE11_wrapped_phase.tif   Negatives     S1AA_20180320T125653_20180401T125653_VVP012_INT80_G_ueF_E415_wrapped_phase.tif     S1BB_20210911T032038_20210923T032038_VVP012_INT80_G_ueF_64CA_wrapped_phase.tif

[ ]:
mask_model_path = "models/masking_model"
pres_model_path = "models/classification_model"
dataset_path = "SAR_DATA/"

tile_size = 512
crop_size = 512

save_images = False
output_dir = "SAR_DATA/Masks"

Run Evaluation Function#

[ ]:
inference.test_model(
    mask_model_path,
    pres_model_path,
    dataset_path,
    tile_size,
    crop_size,
    save_images,
    output_dir,
)