Description Usage Arguments Value Examples
View source: R/tileLevelClassifier.R
The Images should be in this folder: file.path(homeDir,chipsName,flightName,tileName,Unclassified)
1 2 3 | tileLevelClassifier(homeDir = getwd(), chipsName = "Chips", flightName,
tileName, modelObj, exportResults = TRUE, returnPlotData = FALSE,
filterThreshold = 0.2)
|
homeDir |
Base Directory. Needs "Chips" folder. |
chipsName |
Folder name of the chips |
flightName |
Name of flight to classify |
tileName |
Name of tile to classify |
modelObj |
A DIMEC model object. |
exportResults |
Logical. Option to export results for later analysis |
returnPlotData |
Logical. Option to return plotData from function. |
Returns either a data.frame of classifications, or outputs it to a plotData.csv, and two kml files, or both. Outputs to "getwd()/Model Output". Optionally exports the results as a set of files in directories, including positive images, kml's of positives, and the full model results
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## Not run:
modelLabel <- "M17"
modelDir <- file.path("Model Files",
modelLabel,
paste0("ModelFile-",modelLabel,".h5"))
model <- keras::load_model_hdf5(file.path(modelDir,
paste0("ModelFile-",modelLabel,".h5")))
classNames <- read.table(file.path(modelDir, "classes.txt"))[,1]
## Dos Rios Flight
setwd("F:/Adam Cummings/GoogleImagery/FirstPurchase/")
dirList <- list.dirs("Chips/ca_dosrios_20170813",recursive = FALSE,
full.names=FALSE) ##160 directories
tileLevelClassifier(flightName = "ca_dosrios_20170813",
tileName = "C15_R01-DosRios2016",
modelName=modelLabel,
exportResults = TRUE,
returnPlotData = FALSE,
classes=classNames)
##Use flightLevelClassifier to classify many tiles at once:
flightLevelClassifier(dirList,
flightName = "ca_dosrios_20170813",
modelName=modelLabel,
exportResults = TRUE,
returnPlotData = FALSE,
classes=classNames)
## This also works:
sapply(dirList,tileLevelClassifier,
flightName = "ca_dosrios_20170813",
modelName=modelLabel,
exportResults = TRUE,
returnPlotData = FALSE,
classes=classNames)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.