-
Notifications
You must be signed in to change notification settings - Fork 1
/
ui.R
76 lines (65 loc) · 1.92 KB
/
ui.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
req.packages=c("shiny","jpeg","tesseract","wordcloud","tm","RColorBrewer","quanteda","DT")
if(any(! req.packages %in% installed.packages()))
stop(
paste0("Not all dependent packages are installed on your computer.\n Please install: ",
paste(req.packages[!req.packages %in% installed.packages()],collapse=","),
". See '?install.packages' for more information on how to install R packages.")
)
library(shiny)
library(shinythemes)
library(jpeg)
library(tesseract)
library(wordcloud)
library(tm)
library(RColorBrewer)
library(quanteda)
library(DT)
library(shinyWidgets)
shinyUI(fluidPage(theme="file.css",
div(class="myTitle",
titlePanel("OCR Made Simpler")),
setBackgroundColor(
color = c("#5600a1","#2387d7"),
gradient = "linear",
direction = "top"
),
titlePanel(""),
div(class="myContent",
sidebarLayout(
sidebarPanel(width = 3,
fileInput('file1', 'Choose an image (max 5MB)'),
tags$hr(),
sliderInput("maxwords", "Maximum number of words in cloud:", 1, 200, 100),
sliderInput("minfreq","Minimum word frequency in cloud:",1,200,20),
checkboxInput("stopwords", "Remove (English) stopwords", value = FALSE)
),
mainPanel(
tabsetPanel(
tabPanel(
"Introduction",
htmlOutput("intro")
),
tags$tab(
tags$style(type = "text/css", "a{color: #ffffff;}")
),
tabPanel(
"Image & extracted text",
fluidRow(
column(
width=7,
imageOutput("plaatje")
),
column(
width=5,
verbatimTextOutput("OCRtext")
)
)
),
tabPanel(
"Wordcloud",
plotOutput("cloud", height = "600px")
)
)
)
))
))