tileLevelClassifier: Tile Level Classifier.

Description Usage Arguments Value Examples

View source: R/tileLevelClassifier.R

Description

The Images should be in this folder: file.path(homeDir,chipsName,flightName,tileName,Unclassified)

Usage

1
2
3
tileLevelClassifier(homeDir = getwd(), chipsName = "Chips", flightName,
  tileName, modelObj, exportResults = TRUE, returnPlotData = FALSE,
  filterThreshold = 0.2)

Arguments

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.

Value

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

Examples

 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)

adamkc/DIMEChelper documentation built on Feb. 1, 2020, 12:24 p.m.