Title: | Tool for Annotating Images in Preparation for Analysis |
---|---|
Description: | A tool to help create shiny apps for selecting and annotating elements of images. Users must supply images, questions, and answer choices. The user interface is a dynamic shiny app, that displays the images and questions and answer choices. The data generated can be saved to a file that can be used for subsequent analysis. The original purpose was to annotate still images from tennis video for face recognition and emotion detection purposes. |
Authors: | Stephanie Kobakian [aut, cre], Mitchell O'Hara-Wild [aut] |
Maintainer: | Stephanie Kobakian <[email protected]> |
License: | GPL-3 |
Version: | 0.1.2 |
Built: | 2024-10-29 04:02:25 UTC |
Source: | https://github.com/srkobakian/taipan |
This function produces all necessary files for a shiny app. It requires a list of questions to ask users, the location of the images to display and the directory for the folder of shiny app files. Changes can be made to the appearance by altering the css in the folder.
buildTaipan(questions, images, appdir, launch = TRUE, overwrite = FALSE, skip_check = FALSE, ext_restricted = TRUE)
buildTaipan(questions, images, appdir, launch = TRUE, overwrite = FALSE, skip_check = FALSE, ext_restricted = TRUE)
questions |
a |
images |
a vector of image locations, can be local or URLs |
appdir |
location to export the completed app |
launch |
launch the app from the new directory after build is completed |
overwrite |
replace the contents of the supplied location with the completed app |
skip_check |
if TRUE, the requirement for user input to overwrite an existing app is removed |
ext_restricted |
if TRUE only JPEG (JPG), PNG, GIF, SVG are acceptable image formats, all other types will be removed |
## Not run: library(taipan) library(shiny) questions <- taipanQuestions( scene = div(radioButtons("graphic", label = "2D Graphic", choices = list("Live image", "2D Graphic")), radioButtons("bg", label = "Background", choices = list("Crowd", "Court", "Logo wall", "Not applicable")), radioButtons("person", label = "Detectable Person", choices = list("Yes", "No")), radioButtons("shotangle", label = "Shot angle", choices = list("Level with players", "Birds eye", "Upward angle")), radioButtons("situation", label = "Situation", choices = list("Court in play", "Court player close-up", "Court close-up not player", "Crowd", "Off court close up of player", "Transition"))), selection = div(radioButtons("detect", label = "Detect Face", choices = list("Player" , "Other staff on court", "Fan", "None")), radioButtons("obscured", label = "Face obscured", choices = list("Yes", "No")), radioButtons("lighting", label = "Lighting", choices = list("Direct sunlight", "Shaded", "Partially shaded")), radioButtons("headangle", label = "Head angle", choices = list("Front on", "Back of head", "Profile", "Other")), radioButtons("glasses", label = "Glasses", choices = list("Yes", "No")), radioButtons("visorhat", label = "Visor/hat", choices = list("Yes", "No"))) ) images = c("https://raw.githubusercontent.com/srkob1/taipan/master/sample_images/blue_player.png", "https://raw.githubusercontent.com/srkob1/taipan/master/sample_images/pink_player.png", "https://raw.githubusercontent.com/srkob1/taipan/master/sample_images/red_player.png", "https://raw.githubusercontent.com/srkob1/taipan/master/sample_images/yellow_player.png", "https://raw.githubusercontent.com/srkob1/taipan/master/sample_images/disgruntled_player.png") buildTaipan( questions = questions, images = images, appdir = file.path(tempdir(), "taipan") ) ## End(Not run)
## Not run: library(taipan) library(shiny) questions <- taipanQuestions( scene = div(radioButtons("graphic", label = "2D Graphic", choices = list("Live image", "2D Graphic")), radioButtons("bg", label = "Background", choices = list("Crowd", "Court", "Logo wall", "Not applicable")), radioButtons("person", label = "Detectable Person", choices = list("Yes", "No")), radioButtons("shotangle", label = "Shot angle", choices = list("Level with players", "Birds eye", "Upward angle")), radioButtons("situation", label = "Situation", choices = list("Court in play", "Court player close-up", "Court close-up not player", "Crowd", "Off court close up of player", "Transition"))), selection = div(radioButtons("detect", label = "Detect Face", choices = list("Player" , "Other staff on court", "Fan", "None")), radioButtons("obscured", label = "Face obscured", choices = list("Yes", "No")), radioButtons("lighting", label = "Lighting", choices = list("Direct sunlight", "Shaded", "Partially shaded")), radioButtons("headangle", label = "Head angle", choices = list("Front on", "Back of head", "Profile", "Other")), radioButtons("glasses", label = "Glasses", choices = list("Yes", "No")), radioButtons("visorhat", label = "Visor/hat", choices = list("Yes", "No"))) ) images = c("https://raw.githubusercontent.com/srkob1/taipan/master/sample_images/blue_player.png", "https://raw.githubusercontent.com/srkob1/taipan/master/sample_images/pink_player.png", "https://raw.githubusercontent.com/srkob1/taipan/master/sample_images/red_player.png", "https://raw.githubusercontent.com/srkob1/taipan/master/sample_images/yellow_player.png", "https://raw.githubusercontent.com/srkob1/taipan/master/sample_images/disgruntled_player.png") buildTaipan( questions = questions, images = images, appdir = file.path(tempdir(), "taipan") ) ## End(Not run)
Produces a set of scene and selection questions suitable for use in
buildTaipan
taipanQuestions(scene, selection)
taipanQuestions(scene, selection)
scene |
a shiny UI object containing shiny inputs and web elements. These questions relate to the entire image. |
selection |
a shiny UI object containing shiny inputs and web elements. These questions relate to each selected area of an image. There is no limit on how many times these questions will be asked. |
## Not run: questions <- taipanQuestions( scene = div(radioButtons("graphic", label = "2D Graphic", choices = list("Live image", "2D Graphic")), radioButtons("bg", label = "Background", choices = list("Crowd", "Court", "Logo wall", "Not applicable")), radioButtons("person", label = "Detectable Person", choices = list("Yes", "No")), radioButtons("shotangle", label = "Shot angle", choices = list("Level with players", "Birds eye", "Upward angle")), radioButtons("situation", label = "Situation", choices = list("Court in play", "Court player close-up", "Court close-up not player", "Crowd", "Off court close up of player", "Transition"))), selection = div(radioButtons("detect", label = "Detect Face", choices = list("Player" , "Other staff on court", "Fan", "None")), radioButtons("obscured", label = "Face obscured", choices = list("Yes", "No")), radioButtons("lighting", label = "Lighting", choices = list("Direct sunlight", "Shaded", "Partially shaded")), radioButtons("headangle", label = "Head angle", choices = list("Front on", "Back of head", "Profile", "Other")), radioButtons("glasses", label = "Glasses", choices = list("Yes", "No")), radioButtons("visorhat", label = "Visor/hat", choices = list("Yes", "No"))) ) ## End(Not run)
## Not run: questions <- taipanQuestions( scene = div(radioButtons("graphic", label = "2D Graphic", choices = list("Live image", "2D Graphic")), radioButtons("bg", label = "Background", choices = list("Crowd", "Court", "Logo wall", "Not applicable")), radioButtons("person", label = "Detectable Person", choices = list("Yes", "No")), radioButtons("shotangle", label = "Shot angle", choices = list("Level with players", "Birds eye", "Upward angle")), radioButtons("situation", label = "Situation", choices = list("Court in play", "Court player close-up", "Court close-up not player", "Crowd", "Off court close up of player", "Transition"))), selection = div(radioButtons("detect", label = "Detect Face", choices = list("Player" , "Other staff on court", "Fan", "None")), radioButtons("obscured", label = "Face obscured", choices = list("Yes", "No")), radioButtons("lighting", label = "Lighting", choices = list("Direct sunlight", "Shaded", "Partially shaded")), radioButtons("headangle", label = "Head angle", choices = list("Front on", "Back of head", "Profile", "Other")), radioButtons("glasses", label = "Glasses", choices = list("Yes", "No")), radioButtons("visorhat", label = "Visor/hat", choices = list("Yes", "No"))) ) ## End(Not run)