This project is meant to explore the use of R Shiny with cloud APIs such as Google Vision.
There are two motivations:
- Provide other R users a template for integrating Google Vision with their R Shiny applications.
- Apply Google Vision in an R shiny project for a health application such as:
- emotion recognition for those who have trouble with social interactions, validation of coded image data, and many other applications.
- The following features from Google Vision has been implemented with this application:
- Facial Detection, Object Localization, Text Detection, Landmark Detection, and Logo Detection.
A project demo can be found here. Note that the demo works most reliably with Google Chrome.
First, be sure to have R
installed on your computer. The version this application was developed with is R version 3.5.1
. Here's a link to get started. In addition, R Studio may also be needed.
Once you have R installed on your computer, run
install.packages("devtools")
in your R session.
Next, be sure to install RoogleVision
and magick
libraries.
This particular application uses a forked version of RoogleVision
in order to use additional features such as object localization not yet in the original.
-
It can be installed with
devtools::install_github("shaun-jacks/RoogleVision")
. -
Run
install.packages("magick")
to install the magick library
Once you have the prerequisite libraries, run devtools::install_github("shaun-jacks/shiny_vision")
to download repo, or fork this repository.
This project requires Google Authentication. To authenticate, the following link can help you get started. Follow the instructions, and then copy your client_id and client_secret to your .Renviron.
When you have your client_id and client_secret keys, save these to your .Renviron with file.edit("path/to/.Renviron")
. In my case, file.edit("~/.Renviron")
.
Now, add the following lines:
googleAuthR.cliend_id = "YOUR_CLIENT_ID_HERE"
.googleAuthR.client_secret = "YOUR_CLIENT_SECRET_HERE"
.
Now save the file and Restart your R session.
To run the app, runApp("visionAnalyze")
.
- Shaun Jackson
This project is licensed under the MIT License, for further details, see LICENSE.
Thanks to RoogleVision, and the Google Vision team for making this project possible using the APIs created. Also thanks to HackDavis19, which was a vital catalyst to getting this project started when thinking of possible Machine Learning Health Applications.
Lastly, this blog by Scott Scoltzman was extremely helpful for getting started, as well as this TensorFlow for R blog. In addition, this magick intro also provided much aide.