Title: | Create Array Data from 2D Image Thumbnails via Google Image Search |
---|---|
Description: | Images are provided as an array dataset of 2D image thumbnails from Google Image Search <https://www.google.com/search>. This array data may be suitable for a training data of machine learning or deep learning as a first trial. |
Authors: | Satoshi Kume [aut, cre] |
Maintainer: | Satoshi Kume <[email protected]> |
License: | Artistic-2.0 |
Version: | 0.99.7 |
Built: | 2024-12-29 03:20:33 UTC |
Source: | https://github.com/kumes/googleimage2array |
This function is to bind two arrays to one array along the first dimension, which obtained by the GoogleImage2array function.
bind.array(x, y)
bind.array(x, y)
x |
a list obtained by the GoogleImage2array function. |
y |
a list obtained by the GoogleImage2array function. |
array
Satoshi Kume
library(EBImage) # Simple examples query <- "persian cat" CatImg <- GoogleImage2array(query) query <- "Shiba inu" DogImg <- GoogleImage2array(query) #bind arrays Dat <- bind.array(CatImg, DogImg) str(Dat)
library(EBImage) # Simple examples query <- "persian cat" CatImg <- GoogleImage2array(query) query <- "Shiba inu" DogImg <- GoogleImage2array(query) #bind arrays Dat <- bind.array(CatImg, DogImg) str(Dat)
This function is to create a 2D tiled image from the R array/tensor obtained from Google image search.
display.array(x, Save = FALSE, file_path = NULL)
display.array(x, Save = FALSE, file_path = NULL)
x |
a list obtained by the GoogleImage2array function. |
Save |
a logical. Whether to save images locally or not. if TRUE, save locally. |
file_path |
a character. a directory to save the image file. |
image
Satoshi Kume
# Simple examples query <- "persian cat" CatImg <- GoogleImage2array(query) #show images display.array(CatImg) query <- "Shiba inu" DogImg <- GoogleImage2array(query) #show images display.array(DogImg)
# Simple examples query <- "persian cat" CatImg <- GoogleImage2array(query) #show images display.array(CatImg) query <- "Shiba inu" DogImg <- GoogleImage2array(query) #show images display.array(DogImg)
This function is to create a spiral imagethe from R array/tensor obtained from Google image search.
display.spiral(x, Save = FALSE, SaveFormat = "png", file_path = NULL)
display.spiral(x, Save = FALSE, SaveFormat = "png", file_path = NULL)
x |
a list obtained by the GoogleImage2array function. |
Save |
a logical. Whether to save images locally or not. if TRUE, save locally. |
SaveFormat |
a character of format; png or pdf. |
file_path |
a character. a directory to save the image file. |
image
Satoshi Kume
library(EBImage) # Simple examples query <- "persian cat" CatImg <- GoogleImage2array(query) #show images display.spiral(CatImg)
library(EBImage) # Simple examples query <- "persian cat" CatImg <- GoogleImage2array(query) #show images display.spiral(CatImg)
This function is to create the R array/tensor from 2D image obtained from Google image search. This function provides an array consisted of 20 images per run.
GoogleImage2array( Query, wh = 64, Col = TRUE, Save = FALSE, file_path = NULL, Display = FALSE, gl = "us" )
GoogleImage2array( Query, wh = 64, Col = TRUE, Save = FALSE, file_path = NULL, Display = FALSE, gl = "us" )
Query |
a character vector to search images |
wh |
a value of pixels in height and width. |
Col |
a logical. Whether to handle color or gray images. if TRUE, use color mode. |
Save |
a logical. Whether to save images locally or not. if TRUE, save locally. |
file_path |
a character. a directory to save the image file. |
Display |
a logical; display images or not. |
gl |
a character to show a region information. ex. us, ja etc |
array
Satoshi Kume
library(EBImage) # Simple examples query <- "persian cat" CatImg <- GoogleImage2array(query) #show info str(CatImg) query <- "Shiba inu" DogImg <- GoogleImage2array(query) #show info str(DogImg) #Bind arrays ImgDat <- unname(EBImage::abind(CatImg$array, DogImg$array, along=1)) #show info str(ImgDat)
library(EBImage) # Simple examples query <- "persian cat" CatImg <- GoogleImage2array(query) #show info str(CatImg) query <- "Shiba inu" DogImg <- GoogleImage2array(query) #show info str(DogImg) #Bind arrays ImgDat <- unname(EBImage::abind(CatImg$array, DogImg$array, along=1)) #show info str(ImgDat)
This function is to gather images via 10 countries and create the R array/tensor from 2D images obtained.
GoogleImage2array.world(Query, wh = 64, Col = TRUE, verbose = FALSE)
GoogleImage2array.world(Query, wh = 64, Col = TRUE, verbose = FALSE)
Query |
a character vector to search images |
wh |
a value of pixels in height and width. |
Col |
a logical. Whether to handle color or gray images. if TRUE, use color mode. |
verbose |
Verbosity mode (FALSE: silent, TRUE: progress). |
array
Satoshi Kume
## Not run: library(EBImage) # Simple examples query <- "persian cat" CatImg <- GoogleImage2array.world(query) #show info str(CatImg) ## End(Not run)
## Not run: library(EBImage) # Simple examples query <- "persian cat" CatImg <- GoogleImage2array.world(query) #show info str(CatImg) ## End(Not run)