I want to express the scenario – the funny result from testing my first image classifier model.
This meme is making fun of me – My first machine learning model did not work very well; it through some hilarious predictions when I tested the model.
The format of this meme is very generic. However, I create my meme from the sketch.
library(magick)
# create a blank image and write text
image <- image_blank(400,
150,
color = "#000000") %>%
image_annotate(text = "WHEN I TEST MY FIRST\nIMAGE CLASSIFIER MODEL",
color = "#FFFFFF",
size = 35,
font = "Impact",
gravity = "center")
# read a muffin image and write text
image_1 <- image_read(path = "https://www.biggerbolderbaking.com/wp-content/uploads/2020/05/Bakery-Style-Lemon-Blueberry-Muffins-WS-Thumbnail.jpg") %>%
image_crop("700x700+200") %>%
image_scale(200)%>%
image_annotate(text = "CHIHUAHUA",
color = "#FF0000",
size = 30,
font = "Impact",
gravity = "southwest")
# read a chihuahua image and write text
image_2 <- image_read(path = "https://www.k9web.com/wp-content/uploads/2021/01/five-purebred-chihuahua-dogs.jpg") %>%
image_crop("230x230+300") %>%
image_scale(200) %>%
image_annotate(text = "MUFFIN",
color = "#FF0000",
size = 30,
font = "Impact",
gravity = "southeast")
# combine two images in one row
second_row <- c(image_1, image_2) %>%
image_append()
# create my meme
meme <- c(image, second_row) %>%
image_append(stack = TRUE)
# write the image
image_write(meme, "my_meme.png")