I'm starting to learn Torch7 to get into the machine learning/ deep learning field and I'm finding it fascinating (and very complicated haha). My main concern, however, is if I can turn this learning into an application - mainly can I turn my Torch7 Lua scripts into a server that an app can use to perform machine learning calculations? And if it's possible, how?
Thank you
You can use waffle. Here's the hello world example on it's page:
local app = require('waffle')
app.get('/', function(req, res)
res.send('Hello World!')
end)
app.listen()
lets say your algorithm is a simple face detector. The input is an image and the output is the face detections in some json format. You can do the following:
local app = require('waffle')
require 'graphicsmagick'
require 'MyAlgorithm'
app.post('/', function(req, res)
local img, detections, outputJson
img = req.form.image_file:toImage()
detections = MyAlgorithm.detect(img:double())
outputJson = {}
if (detections ~= nil) then
outputJson.faceInPicture = true
outputJson.faceDetections = detections
else
outputJson.faceInPicture = false
outputJson.faceDetections = nil
end
res.json(outputJson)
end)
app.listen()
That way your algorithm can be used as an independent service.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With