score_jp2_image_dir: Score a directory of jp2 images with a Keras model

Description Usage Arguments Value

Description

Score a directory of jp2 images with a Keras model

Usage

1
2
3
4
score_jp2_image_dir(jp2_dir, jp2_aux_dir, model_params_dput_file,
  model_h5_weights, score_outdir = NULL, compress_score_rds = FALSE,
  return_score = TRUE, verbose = FALSE, tile_overlap = 0,
  complete_image = FALSE)

Arguments

jp2_dir

Path to directory containing .jp2 image files

jp2_aux_dir

Path to directory containing .jp2.aux.xml files with metadata about .jp2 image with corresponding name

model_params_dput_file

Path to file containing dput export of parameters used during training of the model contained in 'model_h5_weights'.

model_h5_weights

Saved h5 weights from a trained keras model, used to score the image tiles.

score_outdir

Path to directory where results of image scoring should be save

compress_score_rds

Should saved score results be compressed

return_score

Should list of score results be returned as an R object by the function

verbose

Should messages about current step being processes be printed to screen?

tile_overlap

Number of pixel overlap in adjacent tiles (in both X and Y directions). See calc_slice_corners.

complete_image

See calc_slice_corners.

Value

List of data frame with one row for each tile, containing: - jp2_path - jp2_aux_path - Numeric tile ID number - Tile corner cells in source jp2 pixel values - List-column containing each tile's extent based on the source jp2's projected raster - sf geometry column containing each tile's sf polygon - List-column containing tile's RGB layers in a 4d array of dimension \[1, tile_n_cols, tile_n_rows, 3\] - Model predicted probability for each image tile

If score outpath != NULL each returned data frame will be saved to outpath as an RDS file, compressed if compress_score_rds == TRUE.


treysp/coolit documentation built on June 5, 2019, 5:16 p.m.