An R Shiny app to recognize flower species

Introduction Playing around with PyTorch and R Shiny resulted in a simple Shiny app where the user can upload a flower image, the system will then predict the flower species.

Steps that I took

  1. Download labeled flower data from the Visual Geometry Group,

  2. Install Pytorch and download their transfer learning tutorial script,

  3. You need to slightly adjust the script to work on the flower data,

  4. Train and Save the model as a (*.pt) file, 

  5. Using the R reticulate package you can call python code from within R so that you can use a pytorch models in R,

  6. Create a Shiny app that allows the user to upload an image and display the predicted flower species.

Github repo with: Python notebook to fine tune the resnet18 model, R script with Shiny App, data folder with images.

Live running shiny app can be found here. 

Cheers, Longhow

Related