captcha_transform_image | R Documentation |
This function uses the torchvision
package to read and transform the
image in a torch tensor. The function tries to adjust the dimensions to
deal with black and white or colored images.
captcha_transform_image(x, input_dim = c(32L, 192L))
x |
character vector with the paths to image files. |
input_dim |
resize image to dimension. Defaults to 32x192, which is a good default for many Captcha applications. |
torch tensor with dimensions length(x)
x3
xinput_dim
.
if (torch::torch_is_installed()) {
captcha_file <- fs::dir_ls(
system.file("examples/captcha/", package = "captcha"
))
result <- captcha_transform_image(captcha_file)
class(result)
dim(result)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.