labelMe
labelMe
is a package allowing clinicians and developers with test image data that requires manual labeling (ex. ultrasounds) to easily spin up a local web application to do so, ensuring data privacy while enabling the interactive convenience of the browser as a platform for this task. This is particularly useful to those who work with image-recognition algorithms.
Organize your imaging files in a single directory, or group them into several easily-accessible directories. Then, install the package, use its functions to set your desired labels, and run your webapp locally!
require("devtools")
devtools::install_github("gabmorg/labelme-goldenberg")
library("labelMe")
Save the following images to your local machine:
Call labelMe::serveMe(list("test label1", "test label2"))
to launch the test app (replacing the strings with whatever labels you'd like to apply to the images)
Note where images for labeling are located on your local machine
Call labelMe::startLabelingGoldenberg()
in an R session to launch the app (within RStudio or Terminal)
Upload the files to the Shiny app using the file browser on the right-hand panel; this will change the label of the radio button groups to the name of the uploaded files
Use CTRL + A
to select all the images in a directory for batch upload
Select one option in each column of the radio buttons, according to the image presented on the screen
Your selected choices are textually summarized below the radio group
Press the <- and -> buttons on your keyboard to navigate between images
Click the "Download DATE-labels.csv"
button to download the CSV to your local machine.
If using a lab computer, please create a folder in your Desktop using your first name, and save CSVs in there
Click "flush data"
to remove labeled images from the (local) server
Repeat steps 3-7 as needed until all images are labeled
The author of this package is Gabriela Morgenshtern. The functions available within this package include:
library("labelMe")
lsf.str("package:labelMe")
The above functions, and the helper functions involved in running it were authored by Gabriela Morgenshtern, using the Shiny R package, and with help structuring the app from the Shiny tutorial found on steps 1-6 here: (https://shiny.rstudio.com/tutorial/)
Thanks to Dr. Boris Steipe for providing the skeleton setup for this package through his own template (https://github.com/hyginn/rpt). Code for testing Shiny app was borrowed from a Shinytest tutorial by Ferand Dalatieh; specific examples of his contribution are denoted in the code. Starter code for the logic pertaining to pagination of images and radio buttons was found from Stéphane Laurent (https://stackoverflow.com/questions/57891201/render-images-for-interactive-display-from-folder-loaded-with-shinydirchoose)
The rest of the contributions are made by Gabriela.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.