loadModel {imageseg}R Documentation

Load TensorFlow model from hdf5 file

Description

Load TensorFlow model from hdf5 file

Usage

loadModel(modelFile, restoreCustomObjects = TRUE)

Arguments

modelFile

character. File name of the .hdf5 model file to load

restoreCustomObjects

logical. Restore custom objects (loss function & dice coefficient) used in training of habitat models

Details

Loads a trained TensorFlow model from a hdf5 file, and (optionally) restores custom objects.

Value

keras model

Examples

## Not run: 
# Canopy model
wd_model_can <- "C:/Path/To/Model"      # change this
filename_model_can <- "imageseg_canopy_model.hdf5"
model_can <- loadModel(file.path(wd_model_can, filename_model_can))

# Understory model
# note, here we just specify the complete path, not separate by directory and file name as above
model_file_us <- "C:/Path/To/Model/imageseg_understory_model.hdf5"
model_us <- loadModel(model_file_us)

## End(Not run)

[Package imageseg version 0.5.0 Index]