Skip to contents

Counts instances of each class for MegaDetector/SpeciesNet across images in JSON data.

Usage

megadet_get_counts(json, type = "detection", map_names = TRUE)

Arguments

json

character vector or nested list object from jsonlite::read_json(). The JSON file or loaded JSON data to filter on.

type

character. "detection" if counts should be done from MegaDetector's gross categories or "classification" for counts from SpeciesNet's species-level classifications.

map_names

boolean. If MegaDetector and SpeciesNet names should be mapped from numeric values to the values provided in the detection_categories and classification_categories tags. These are typically gross (human, animal, vehicle) and taxonomic classifications respectively.

Value

a dataframe with a category and count column.