View source: R/sequenceClassification.R
sequenceClassification | R Documentation |
This function applies image classifications at a sequence level by leveraging information from multiple images. A sequence is defined as all images at the same camera/station where the time between consecutive images is <=maxdiff. This can improve classification accuracy, but assumes that only one species is present in each sequence. If you regularly expect multiple species to occur in an image or sequence don't use this function.
sequenceClassification(
animals,
empty = NULL,
predictions,
classes,
emptyclass = "",
stationcolumn,
sortcolumns = NULL,
maxdiff = 60
)
animals |
sub-selection of all images that contain MD animals |
empty |
optional, data frame non-animal images (empty, human and vehicle) that will be merged back with animal imagages |
predictions |
data frame of prediction probabilities from the classifySpecies function |
classes |
a vector or species corresponding to the columns of 'predictions' |
emptyclass |
a string indicating the class that should be considered 'Empty' |
stationcolumn |
a column in the animals and empty data frame that indicates the camera or camera station |
sortcolumns |
optional sort order. The default is 'stationcolumnumn' and DateTime. |
maxdiff |
maximum difference between images in seconds to be included in a sequence, defaults to 60 |
This function retains "Empty" classification even if other images within the sequence are predicted to contain animals. Classification confidence is weighted by MD confidence.
data frame with predictions and confidence values for animals and empty images
## Not run:
predictions <-classifyCropsSpecies(images,modelfile,resize=456)
animals <- allframes[allframes$max_detection_category==1,]
empty <- setEmpty(allframes)
animals <- sequenceClassification(animals, empty, predictions, classes,
emptyclass = "Empty",
stationcolumnumn="StationID", maxdiff=60)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.