# NOT RUN {
# }
# NOT RUN {
# Example 1: Canopy
wd_images <- system.file("images/canopy/resized",
package = "imageseg")
images <- loadImages(imageDir = wd_images)
x <- imagesToKerasInput(images)
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))
results_can <- imageSegmentation(model = model_can,
x = x)
results_can$image
results_can$prediction
results_can$prediction_binary
results_can$vegetation
# Example 2: Understory
wd_images_us <- system.file("images/understory/resized",
package = "imageseg")
images_us <- loadImages(imageDir = wd_images_us)
x <- imagesToKerasInput(images_us)
# 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)
results_us <- imageSegmentation(model = model_us,
x = x)
results_us$image
results_us$prediction
results_us$prediction_binary
results_us$vegetation
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab