Skip to contents

Returns a label for an image using a fitted model. The image can be either a character vector (of length one or more) or an object of class captcha.

Usage

decrypt(files, model)

Arguments

files

files to read. Can be either a character vector or an object of class captcha.

model

model of class luz_module_fitted

Value

character vector of the predicted labels.

Examples


captcha_file <- system.file(
  "examples/captcha/cadesp.jpg",
  package = "captcha"
)

cap <- read_captcha(captcha_file)

if (interactive()) {
  plot(cap)
}

# the code below uses access to the internet. If you want to run locally,
# download the model object from the releases site.
if (interactive() && torch::torch_is_installed()) {
  model <- captcha_load_model("cadesp")
  decrypt(cap, model_rfb)
}