-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroutes.jl
More file actions
executable file
·33 lines (27 loc) · 788 Bytes
/
Copy pathroutes.jl
File metadata and controls
executable file
·33 lines (27 loc) · 788 Bytes
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
using Genie.Router, Genie.Renderer.Html, Genie.Requests, Base64
include("src/Sense.jl")
function f(x)
println("Done!")
end
route("/") do
serve_static_file("index.html")
end
route("/see", method=POST) do
img = base64decode(postpayload(:drawing))
test_case = [
[[101,100,100],[102,100,100]],
[[103,100,100],[104,100,100]],
[[105,100,100],[106,100,100]],
[[107,100,100],[108,100,100]]
]
println(Sense.convertRGBtoGrayscale(test_case))
#println(postpayload(:drawing))
#println(base64decode(postpayload(:drawing)))
if img != Nothing
# Calling digit recognition function
predicted_digit = Sense.seeDigit(img);
return "{\"msg\": \"$predicted_digit\"}"
else
return "{\"msg\": \"*** No image under drawing key uploaded.\"}"
end
end