values$img_res
|
|____$fdBoundingPoly
| |
| |_____$vertices
| |_____[[1]] # face 1
| |_______$x: [[1]] [[2]] [[3]] [[4]]
| | |____1285, 2322, 2322, 1285
| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as fs from 'fs' | |
import * as path from 'path' | |
class Input { | |
buffer: Buffer | undefined; | |
parsed: number[][][] | undefined | |
readBuffer() { | |
this.buffer = fs.readFileSync(path.join(process.cwd(), 'day5', 'input', 'input.txt')) | |
} | |
parseBuffer() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as fs from 'fs' | |
import * as path from 'path' | |
import * as process from 'process' | |
const inputDir = path.join(process.cwd(), 'day4', 'input'); | |
import { BehaviorSubject, combineLatest, concatMap, Observable, Subject } from 'rxjs' | |
function parseDraws(): number[] { | |
const drawsString = fs.readFileSync(path.join(inputDir, 'random_numbers.txt'), 'utf-8').toString(); | |
return drawsString.split(",").map(num => parseInt(num, 10)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This generates a string that will be used within the render fxn | |
# in handsontable(). The string needs two parameters for this fxn to work: | |
# 1. A list of columns: so a list named col_highlight, with keys: | |
# colhighlight1, colhighlight2 ... up to vars_len. Each key has a corresponding | |
# value which is the column number within the handsontable to color | |
# 1. A list of lists of rows: so a list named row_highlight, with keys: | |
# rowhighlight1, row_highlight2 ... up to vars_len. Each key has a corresponding | |
# value which is a vector of row numbers within the handsontable to color | |
# The highlighted cells are the cells represented by colhighight1, rowhighlight1,... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### Analysis Table #### | |
output$results <- DT::renderDataTable({ | |
if (values$analysis_type == "FACE_DETECTION") { | |
as.data.frame( | |
list( | |
joy = values$img_res$joyLikelihood, | |
sorrow = values$img_res$sorrowLikelihood, | |
anger = values$img_res$angerLikelihood, | |
surprise = values$img_res$surpriseLikelihood | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
feature | column names to use | |
---|---|---|
FACE_DETECTION | joyLikelihood; sorrowLikelihood; angerLikelihood; surpriseLikelihood | |
OBJECT_LOCALIZATION | name; score | |
LANDMARK_DETECTION | description; score | |
LABEL_DETECTION | description; score; topicality | |
TEXT_DETECTION | locale; description | |
LOGO_DETECTION | description; score |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## app.R ## | |
library(shinydashboard) | |
ui <- dashboardPage( | |
dashboardHeader(title = "Basic dashboard"), | |
## Sidebar content | |
dashboardSidebar( | |
sidebarMenu( | |
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")), | |
menuItem("Widgets", tabName = "widgets", icon = icon("th")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# stage 2 within our renderUI function | |
shiny::fluidPage( | |
shiny::tagList( | |
# Row 1: our analyzed image | |
shiny::fluidRow( | |
column(8, align = "center", | |
shinycssloaders::withSpinner( # Spinner loading bar | |
imageOutput("picture2"), # Outputted Image | |
color = '#999999' | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## UI STAGE 1 CODE # | |
# begin a sidebar ui page | |
shiny::sidebarLayout( | |
shiny::sidebarPanel( | |
title = "Image and Analysis Selection", | |
# ask for file input from user | |
shiny::fileInput( | |
inputId = "file1", | |
label = "Input Image", | |
accept = c( |
NewerOlder